The putClientProperty() method in JComponent should fire a property change event describing the new (or cleared) property. I added a test in Mauve for this, and committed this patch to make it work:

2005-09-12  David Gilbert  <[EMAIL PROTECTED]>

        * javax/swing/JComponent.java
        (putClientProperty): fire property change event.

Regards,

Dave Gilbert
Index: javax/swing/JComponent.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v
retrieving revision 1.56
diff -u -r1.56 JComponent.java
--- javax/swing/JComponent.java 15 Aug 2005 19:50:37 -0000      1.56
+++ javax/swing/JComponent.java 12 Sep 2005 22:18:34 -0000
@@ -452,7 +452,9 @@
   /**
    * Add a client property <code>value</code> to this component, associated
    * with <code>key</code>. If there is an existing client property
-   * associated with <code>key</code>, it will be replaced.
+   * associated with <code>key</code>, it will be replaced.  A
+   * [EMAIL PROTECTED] PropertyChangeEvent} is sent to registered listeners 
(with the
+   * name of the property being <code>key.toString()</code>).
    *
    * @param key The key of the client property association to add
    * @param value The value of the client property association to add
@@ -463,10 +465,13 @@
    */
   public final void putClientProperty(Object key, Object value)
   {
+    Hashtable t = getClientProperties();
+    Object old = t.get(key);
     if (value != null)
-      getClientProperties().put(key, value);
+      t.put(key, value);
     else
-      getClientProperties().remove(key);
+      t.remove(key);
+    firePropertyChange(key.toString(), old, value);
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to