Commits

Alex Grönholm committed c6840b4

Roll our own PropertyChangeEvents to avoid invoking the wrong overloaded version of firePropertyChangeEvent (and thus causing unwarranted type conversions)

Comments (0)

Files changed (1)

swingutils/beans.py

 compatible property change notifications.
 
 """
-from java.beans import PropertyChangeSupport
+from java.beans import PropertyChangeSupport, PropertyChangeEvent,\
+    IndexedPropertyChangeEvent
 
 
 class JavaBeanSupport(object):
         if self._changeSupport:
             self._changeSupport.removePropertyChangeListener(*args)
 
-    def firePropertyChange(self, *args):
+    def firePropertyChange(self, propertyName, oldValue, newValue):
         if self._changeSupport:
-            self._changeSupport.firePropertyChange(*args)
+            event = PropertyChangeEvent(self, propertyName, oldValue, newValue)
+            self._changeSupport.firePropertyChange(event)
 
-    def fireIndexedPropertyChange(self, *args):
+    def fireIndexedPropertyChange(self, propertyName, index, oldValue,
+                                  newValue):
         if self._changeSupport:
-            self._changeSupport.fireIndexedPropertyChange(*args)
+            event = IndexedPropertyChangeEvent(self, propertyName, oldValue,
+                                               newValue, index)
+            self._changeSupport.firePropertyChange(event)
 
     def getPropertyChangeListeners(self, *args):
         if self._changeSupport: