I'm currently implementing WrappedPlainView and in doing so and reading
the specs and O'Reilly Swing book I noticed that getTabSize (both in
WrappedPlainView and in PlainView) should try to retrieve the tab size
from the document's properties before defaulting to 8.  This is fixed in
PlainView.


2005-10-14  Anthony Balkissoon  <[EMAIL PROTECTED]>

        * javax/swing/text/PlainView.java:
        (getTabSize): Check the Document's properties for
        PlainDocument.tabSizeAttribute before defaulting to 8.

--Tony
Index: javax/swing/text/PlainView.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/text/PlainView.java,v
retrieving revision 1.24
diff -u -r1.24 PlainView.java
--- javax/swing/text/PlainView.java     13 Oct 2005 20:35:43 -0000      1.24
+++ javax/swing/text/PlainView.java     14 Oct 2005 19:37:11 -0000
@@ -202,2 +202,2 @@
       }
   }

+  /**
+   * Returns the tab size of a tab.  Checks the Document's
+   * properties for PlainDocument.tabSizeAttribute and returns it if it is
+   * defined, otherwise returns 8.
+   *
+   * @return the tab size.
+   */
   protected int getTabSize()
   {
-    return 8;
+    Object tabSize = getDocument().getProperty(PlainDocument.tabSizeAttribute);
+    if (tabSize == null)
+      return 8;
+    return ((Integer)tabSize).intValue();
   }

   /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to