[kaffe] CVS kaffe (robilad): resynced with gnu classpath: swing fix
Kaffe CVS
cvs-commits at kaffe.org
Sun May 15 11:07:27 PDT 2005
PatchSet 6520
Date: 2005/05/15 17:50:06
Author: robilad
Branch: HEAD
Tag: (none)
Log:
resynced with gnu classpath: swing fix
2005-05-15 Dalibor Topic <robilad at kaffe.org>
Resynced with GNU Classpath.
2005-05-11 Roman Kennke <roman at kennke.org>
* javax/swing/JTextField.java
(createDefaultModel): Create and return a subclass of PlainDocument
to allow newlines to be swallowed.
Members:
ChangeLog:1.4046->1.4047
libraries/javalib/javax/swing/JTextField.java:1.9->1.10
Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4046 kaffe/ChangeLog:1.4047
--- kaffe/ChangeLog:1.4046 Sun May 15 17:48:25 2005
+++ kaffe/ChangeLog Sun May 15 17:50:06 2005
@@ -2,6 +2,16 @@
Resynced with GNU Classpath.
+ 2005-05-11 Roman Kennke <roman at kennke.org>
+
+ * javax/swing/JTextField.java
+ (createDefaultModel): Create and return a subclass of PlainDocument
+ to allow newlines to be swallowed.
+
+2005-05-15 Dalibor Topic <robilad at kaffe.org>
+
+ Resynced with GNU Classpath.
+
2005-05-10 David Daney <ddaney at avtrex.com>
* java/util/BitSet.java (get(int, int)): Fix breakage when
Index: kaffe/libraries/javalib/javax/swing/JTextField.java
diff -u kaffe/libraries/javalib/javax/swing/JTextField.java:1.9 kaffe/libraries/javalib/javax/swing/JTextField.java:1.10
--- kaffe/libraries/javalib/javax/swing/JTextField.java:1.9 Fri Feb 18 11:26:36 2005
+++ kaffe/libraries/javalib/javax/swing/JTextField.java Sun May 15 17:50:06 2005
@@ -47,6 +47,8 @@
import java.beans.PropertyChangeListener;
import javax.accessibility.AccessibleStateSet;
+import javax.swing.text.AttributeSet;
+import javax.swing.text.BadLocationException;
import javax.swing.text.Document;
import javax.swing.text.JTextComponent;
import javax.swing.text.PlainDocument;
@@ -187,7 +189,15 @@
*/
protected Document createDefaultModel()
{
- return new PlainDocument();
+ // subclassed to swallow newlines
+ return new PlainDocument() {
+ public void insertString(int offset, String str, AttributeSet a)
+ throws BadLocationException
+ {
+ if (str.indexOf('\n') == -1)
+ super.insertString(offset, str, a);
+ }
+ };
}
/**
More information about the kaffe
mailing list