This adds the isValidateRoot() method to JTextField, which is a nice
little optimization, because otherwise each key press would cause
revalidation of the whole tree.
2006-02-22 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/JTextField.java
(isValidateRoot): New method.
/Roman
Index: javax/swing/JTextField.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JTextField.java,v
retrieving revision 1.29
diff -u -r1.29 JTextField.java
--- javax/swing/JTextField.java 1 Feb 2006 15:25:13 -0000 1.29
+++ javax/swing/JTextField.java 22 Feb 2006 10:02:45 -0000
@@ -530,4 +530,18 @@
// javax.swing.text.FieldView.
return horizontalVisibility;
}
+
+ /**
+ * Returns <code>true</code>, unless this is embedded in a
+ * <code>JViewport</code> in which case the viewport takes responsibility of
+ * validating.
+ *
+ * @return <code>true</code>, unless this is embedded in a
+ * <code>JViewport</code> in which case the viewport takes
+ * responsibility of validating
+ */
+ public boolean isValidateRoot()
+ {
+ return ! (getParent() instanceof JViewport);
+ }
}