Package org.jdesktop.application
Class AbstractBean
java.lang.Object
org.jdesktop.application.AbstractBean
- Direct Known Subclasses:
ActionManager,Application,ApplicationContext,LocalStorage,ResourceManager,Task.InputBlocker,TaskMonitor,TaskService,View
An encapsulation of the PropertyChangeSupport methods based on
java.beans.PropertyChangeSupport. PropertyChangeListeners are fired
on the event dispatching thread.
Note: this class is only public because the so-called "fix" for javadoc bug 4780441 still fails to correctly document public methods inherited from a package private class.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a PropertyChangeListener to the listener list.voidaddPropertyChangeListener(String propertyName, PropertyChangeListener listener) Add a PropertyChangeListener for a specific property.protected voidFire an existing PropertyChangeEventprotected voidfirePropertyChange(String propertyName, Object oldValue, Object newValue) Called whenever the value of a bound property is set.An array of all of thePropertyChangeListenersadded so far.voidRemove a PropertyChangeListener from the listener list.voidremovePropertyChangeListener(String propertyName, PropertyChangeListener listener) Remove a PropertyChangeListener for a specific property.
-
Constructor Details
-
AbstractBean
public AbstractBean()
-
-
Method Details
-
addPropertyChangeListener
Add a PropertyChangeListener to the listener list. The listener is registered for all properties and itspropertyChangemethod will run on the event dispatching thread.If
listeneris null, no exception is thrown and no action is taken.- Parameters:
listener- the PropertyChangeListener to be added.- See Also:
-
removePropertyChangeListener
Remove a PropertyChangeListener from the listener list.If
listeneris null, no exception is thrown and no action is taken.- Parameters:
listener- the PropertyChangeListener to be removed.- See Also:
-
addPropertyChangeListener
Add a PropertyChangeListener for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property. The same listener object may be added more than once. For each property, the listener will be invoked the number of times it was added for that property. IfpropertyNameorlisteneris null, no exception is thrown and no action is taken.- Parameters:
propertyName- The name of the property to listen on.listener- the PropertyChangeListener to be added- See Also:
-
removePropertyChangeListener
Remove a PropertyChangeListener for a specific property. Iflistenerwas added more than once to the same event source for the specified property, it will be notified one less time after being removed. IfpropertyNameis null, no exception is thrown and no action is taken. Iflisteneris null, or was never added for the specified property, no exception is thrown and no action is taken.- Parameters:
propertyName- The name of the property that was listened on.listener- The PropertyChangeListener to be removed- See Also:
-
getPropertyChangeListeners
An array of all of thePropertyChangeListenersadded so far.- Returns:
- all of the
PropertyChangeListenersadded so far. - See Also:
-
firePropertyChange
Called whenever the value of a bound property is set.If oldValue is not equal to newValue, invoke the
propertyChangemethod on all of thePropertyChangeListenersadded so far, on the event dispatching thread.- See Also:
-
firePropertyChange
Fire an existing PropertyChangeEventIf the event's oldValue property is not equal to newValue, invoke the
propertyChangemethod on all of thePropertyChangeListenersadded so far, on the event dispatching thread.- See Also:
-