aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/javax/swing/JTextArea.java
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2005-11-20 07:33:40 +0000
committerDiego Novillo <dnovillo@redhat.com>2005-11-20 07:33:40 +0000
commit334cb8612fc07d2479533d3e589ab678753adaf8 (patch)
treefd3fd3000ec4c751ee405ae2a84ea17169a0126b /libjava/classpath/javax/swing/JTextArea.java
parent69231c6769016efb611e7d2476a74e13a0f8a0db (diff)
Mainline merge as of 2005-11-18.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gomp-20050608-branch@107245 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/javax/swing/JTextArea.java')
-rw-r--r--libjava/classpath/javax/swing/JTextArea.java61
1 files changed, 57 insertions, 4 deletions
diff --git a/libjava/classpath/javax/swing/JTextArea.java b/libjava/classpath/javax/swing/JTextArea.java
index 53591ffcc3a..2fa185b6207 100644
--- a/libjava/classpath/javax/swing/JTextArea.java
+++ b/libjava/classpath/javax/swing/JTextArea.java
@@ -42,6 +42,8 @@ import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Rectangle;
+import javax.accessibility.AccessibleContext;
+import javax.accessibility.AccessibleStateSet;
import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.Element;
@@ -92,6 +94,35 @@ import javax.swing.text.View;
public class JTextArea extends JTextComponent
{
/**
+ * Provides accessibility support for <code>JTextArea</code>.
+ *
+ * @author Roman Kennke (kennke@aicas.com)
+ */
+ protected class AccessibleJTextArea extends AccessibleJTextComponent
+ {
+
+ /**
+ * Creates a new <code>AccessibleJTextArea</code> object.
+ */
+ protected AccessibleJTextArea()
+ {
+ super();
+ }
+
+ /**
+ * Returns the accessible state of this <code>AccessibleJTextArea</code>.
+ *
+ * @return the accessible state of this <code>AccessibleJTextArea</code>
+ */
+ public AccessibleStateSet getAccessibleStateSet()
+ {
+ AccessibleStateSet state = super.getAccessibleStateSet();
+ // TODO: Figure out what state must be added here to the super's state.
+ return state;
+ }
+ }
+
+ /**
* Compatible with Sun's JDK
*/
private static final long serialVersionUID = -6141680179310439825L;
@@ -208,6 +239,8 @@ public class JTextArea extends JTextComponent
/* This shouldn't happen in theory -- but, if it does... */
throw new RuntimeException("Unexpected exception occurred.", exception);
}
+ if (toAppend != null && toAppend.length() > 0)
+ revalidate();
}
/**
@@ -312,8 +345,12 @@ public class JTextArea extends JTextComponent
{
if (columns < 0)
throw new IllegalArgumentException();
-
- this.columns = columns;
+
+ if (columns != this.columns)
+ {
+ this.columns = columns;
+ revalidate();
+ }
}
/**
@@ -337,8 +374,12 @@ public class JTextArea extends JTextComponent
{
if (rows < 0)
throw new IllegalArgumentException();
-
- this.rows = rows;
+
+ if (rows != this.rows)
+ {
+ this.rows = rows;
+ revalidate();
+ }
}
/**
@@ -547,4 +588,16 @@ public class JTextArea extends JTextComponent
return new Dimension(Math.max(reqWidth, neededWidth),
Math.max(reqHeight, neededHeight));
}
+
+ /**
+ * Returns the accessible context associated with the <code>JTextArea</code>.
+ *
+ * @return the accessible context associated with the <code>JTextArea</code>
+ */
+ public AccessibleContext getAccessibleContext()
+ {
+ if (accessibleContext == null)
+ accessibleContext = new AccessibleJTextArea();
+ return accessibleContext;
+ }
}