From 8efae6bbfa04f662589bbfc64dbbe68935f973d2 Mon Sep 17 00:00:00 2001 From: Roman Kennke Date: Mon, 25 Apr 2005 19:36:43 +0000 Subject: 2005-04-25 Roman Kennke * javax/swing/plaf/basic/BasicScrollBarUI.java (initDefaults): Initialize thumb*Color fields correctly. 2005-04-25 Roman Kennke * javax/swing/text/GapContent.java: Added API comments. 2005-04-25 Roman Kennke * javax/swing/plaf/metal/MetalBorders.java: Added inner class ScrollPaneBorder. * javax/swing/plaf/metal/MetalLookAndFeel.java (initComponentDefaults): Added default for "ScrollPane.border" to use the new ScrollPaneBorder. 2005-04-25 Roman Kennke * javax/swing/text/AbstractDocument.java: Added FIXME comments. This class still has to be implemented thread-safe. 2005-04-25 Roman Kennke * javax/swing/tree/DefaultTreeSelectionModel.java (DefaultTreeSelectionModel): Initialize listenerList here. 2005-04-25 Roman Kennke * javax/swing/plaf/metal/MetalTextFieldUI.java (createUI): Return one instance per Component instead of a shared instance. 2005-04-25 Roman Kennke * javax/swing/text/Document.java: Added API documentation comments. 2005-04-25 Roman Kennke * javax/swing/text/AbstractDocument.java (getDocumentProperties): Implemented. (setDocumentProperties): Implemented. (getProperty): Implemented. (putProperty): Implemented. 2005-04-25 Roman Kennke * javax/swing/BoxLayout (preferredLayoutSize): Fixed computation so that it correctly adds the top and bottom insets of the container. 2005-04-25 Roman Kennke * javax/swing/plaf/basic/BasicMenuItemUI.java (paintText): Make use of the 'selectionForeground' UI default for text painting. 2005-04-25 Roman Kennke * javax/swing/plaf/basic/BasicLookAndFeel.java (initSystemColorDefaults): Modified colors to match the BasicLookAndFeel in the reference implementation. (initComponentDefaults): Likewise. From-SVN: r98733 --- libjava/javax/swing/text/AbstractDocument.java | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'libjava/javax/swing/text/AbstractDocument.java') diff --git a/libjava/javax/swing/text/AbstractDocument.java b/libjava/javax/swing/text/AbstractDocument.java index a2c3fa6..29be0ad 100644 --- a/libjava/javax/swing/text/AbstractDocument.java +++ b/libjava/javax/swing/text/AbstractDocument.java @@ -43,6 +43,7 @@ import java.io.Serializable; import java.util.Dictionary; import java.util.Enumeration; import java.util.EventListener; +import java.util.Hashtable; import java.util.Vector; import javax.swing.event.DocumentEvent; @@ -71,7 +72,10 @@ public abstract class AbstractDocument Content content; AttributeContext context; DocumentFilter documentFilter; - + + /** The documents properties. */ + Dictionary properties; + protected EventListenerList listenerList = new EventListenerList(); protected AbstractDocument(Content doc) @@ -175,7 +179,11 @@ public abstract class AbstractDocument public Dictionary getDocumentProperties() { - return null; + // FIXME: make me thread-safe + if (properties == null) + properties = new Hashtable(); + + return properties; } public Position getEndPosition() @@ -201,7 +209,12 @@ public abstract class AbstractDocument public Object getProperty(Object key) { - return null; + // FIXME: make me thread-safe + Object value = null; + if (properties != null) + value = properties.get(key); + + return value; } public Element[] getRootElements() @@ -258,6 +271,11 @@ public abstract class AbstractDocument public void putProperty(Object key, Object value) { + // FIXME: make me thread-safe + if (properties == null) + properties = new Hashtable(); + + properties.put(key, value); } public void readLock() @@ -366,6 +384,8 @@ public abstract class AbstractDocument public void setDocumentProperties(Dictionary x) { + // FIXME: make me thread-safe + properties = x; } protected void writeLock() -- cgit v1.1