This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: javax.swing.JTextArea


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I just commited the attached patch to add two missing methods to 
JTextArea.


Michael


2004-09-02  Michael Koch  <konqueror@gmx.de>

	* javax/swing/JTextArea.java
	(lineWrap): Renamed from "wrapping".
	(wrapStyleWord): NEw field.
	(getLineWrap): Re-edited javadoc comment.
	(setLineWrap): Likewise.
	(getWrapStyleWord): New method.
	(setWrapStyleWord): Likewise.
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBN2xjWSOgCCdjSDsRAhZ4AKCMiwzDT8wAqQOSdhZnycqCBwVkjgCgnkmN
Pl7MntL/wLBfJrTqTGqOrpQ=
=/rD5
-----END PGP SIGNATURE-----
Index: javax/swing/JTextArea.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JTextArea.java,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 JTextArea.java
--- javax/swing/JTextArea.java	20 Jul 2004 14:31:30 -0000	1.1.2.4
+++ javax/swing/JTextArea.java	2 Sep 2004 18:47:00 -0000
@@ -48,8 +48,9 @@
   
   private int rows;
   private int columns;
-  private boolean wrapping;
+  private boolean lineWrap;
   private int tabSize = 8;
+  private boolean wrapStyleWord;
 
   /**
    * Creates a new <code>JTextArea</code> object.
@@ -147,7 +148,7 @@
 
   public boolean getScrollableTracksViewportWidth()
   {
-    return wrapping ? true : super.getScrollableTracksViewportWidth();
+    return lineWrap ? true : super.getScrollableTracksViewportWidth();
   }
 
   /**
@@ -211,28 +212,57 @@
   }
 
   /**
-   * Checks whethet line wrapping is enabled.
+   * Checks whether line wrapping is enabled.
    *
-   * @return true if line wrapping is enabled, false otherwise
+   * @return <code>true</code> if line wrapping is enabled,
+   * <code>false</code> otherwise
    */
   public boolean getLineWrap()
   {
-    return wrapping;
+    return lineWrap;
   }
 
   /**
    * Enables/disables line wrapping.
    *
-   * @param wrapping true to enable line wrapping, false otherwise
+   * @param wrapping <code>true</code> to enable line wrapping,
+   * <code>false</code> otherwise
    */
   public void setLineWrap(boolean flag)
   {
-    if (wrapping == flag)
+    if (lineWrap == flag)
       return;
 
-    boolean oldValue = wrapping;
-    wrapping = flag;
-    firePropertyChange("lineWrap", oldValue, wrapping);
+    boolean oldValue = lineWrap;
+    lineWrap = flag;
+    firePropertyChange("lineWrap", oldValue, lineWrap);
+  }
+
+  /**
+   * Checks whether word style wrapping is enabled.
+   *
+   * @return <code>true</code> if word style wrapping is enabled,
+   * <code>false</code> otherwise
+   */
+  public boolean getWrapStyleWord()
+  {
+    return wrapStyleWord;
+  }
+
+  /**
+   * Enables/Disables word style wrapping.
+   *
+   * @param flag <code>true</code> to enable word style wrapping,
+   * <code>false</code> otherwise
+   */
+  public void setWrapStyleWord(boolean flag)
+  {
+    if (wrapStyleWord == flag)
+      return;
+
+    boolean oldValue = wrapStyleWord;
+    wrapStyleWord = flag;
+    firePropertyChange("wrapStyleWord", oldValue, wrapStyleWord);
   }
 
   public int getTabSize()

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]