diff options
author | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
---|---|---|
committer | Mark Wielaard <mark@gcc.gnu.org> | 2005-11-15 23:20:01 +0000 |
commit | 8f523f3a1047919d3563daf1ef47ba87336ebe89 (patch) | |
tree | a5eb7cf42a51869cc8aa1fad7ad6a90cca47fdd8 /libjava/classpath/javax/swing/JTextArea.java | |
parent | 02e549bfaaec38f68307e7f34e46ea57ea1809af (diff) | |
download | gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.zip gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.tar.gz gcc-8f523f3a1047919d3563daf1ef47ba87336ebe89.tar.bz2 |
Imported GNU Classpath 0.19 + gcj-import-20051115.
* sources.am: Regenerated.
* Makefile.in: Likewise.
* scripts/makemake.tcl: Use glob -nocomplain.
From-SVN: r107049
Diffstat (limited to 'libjava/classpath/javax/swing/JTextArea.java')
-rw-r--r-- | libjava/classpath/javax/swing/JTextArea.java | 61 |
1 files changed, 57 insertions, 4 deletions
diff --git a/libjava/classpath/javax/swing/JTextArea.java b/libjava/classpath/javax/swing/JTextArea.java index 53591ff..2fa185b 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; + } } |