java.lang.Object | |
↳ | java.beans.PropertyChangeSupport |
Manages a list of listeners to be notified when a property changes. Listeners subscribe to be notified of all property changes, or of changes to a single named property.
This class is thread safe. No locking is necessary when subscribing or unsubscribing listeners, or when publishing events. Callers should be careful when publishing events because listeners may not be thread safe.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new instance that uses the source bean as source for any event.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Subscribes
listener to change notifications for all properties. | |||||||||||
Subscribes
listener to change notifications for the property
named propertyName . | |||||||||||
Fires a property change of an integer property with the given name.
| |||||||||||
Fires an
IndexedPropertyChangeEvent with the given name, old
value, new value and index. | |||||||||||
Fires a property change of a boolean property with the given name.
| |||||||||||
Fires a property change of an integer property with the given name.
| |||||||||||
Fires a property change of a boolean property with the given name.
| |||||||||||
Publishes a property change event to all listeners of that property.
| |||||||||||
Fires a
PropertyChangeEvent with the given name, old value and
new value. | |||||||||||
Returns all subscribers.
| |||||||||||
Returns the subscribers to be notified when
propertyName changes. | |||||||||||
Returns true if there are listeners registered to the property with the
given name.
| |||||||||||
Unsubscribes
listener from change notifications for the property
named propertyName . | |||||||||||
Unsubscribes
listener from change notifications for all
properties. |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates a new instance that uses the source bean as source for any event.
sourceBean | the bean used as source for all events. |
---|
Subscribes listener
to change notifications for all properties.
If the listener is already subscribed, it will receive an additional
notification. If the listener is null, this method silently does nothing.
Subscribes listener
to change notifications for the property
named propertyName
. If the listener is already subscribed, it
will receive an additional notification when the property changes. If the
property name or listener is null, this method silently does nothing.
Fires a property change of an integer property with the given name. If the old value and the new value are not null and equal the event will not be fired.
propertyName | the property name |
---|---|
index | the index of the changed property |
oldValue | the old value |
newValue | the new value |
Fires an IndexedPropertyChangeEvent
with the given name, old
value, new value and index. As source the bean used to initialize this
instance is used. If the old value and the new value are not null and
equal the event will not be fired.
propertyName | the name of the property |
---|---|
index | the index |
oldValue | the old value of the property |
newValue | the new value of the property |
Fires a property change of a boolean property with the given name. If the old value and the new value are not null and equal the event will not be fired.
propertyName | the property name |
---|---|
index | the index of the changed property |
oldValue | the old value |
newValue | the new value |
Fires a property change of an integer property with the given name. If the old value and the new value are not null and equal the event will not be fired.
propertyName | the property name |
---|---|
oldValue | the old value |
newValue | the new value |
Fires a property change of a boolean property with the given name. If the old value and the new value are not null and equal the event will not be fired.
propertyName | the property name |
---|---|
oldValue | the old value |
newValue | the new value |
Publishes a property change event to all listeners of that property. If the event's old and new values are equal (but non-null), no event will be published.
Fires a PropertyChangeEvent
with the given name, old value and
new value. As source the bean used to initialize this instance is used.
If the old value and the new value are not null and equal the event will
not be fired.
propertyName | the name of the property |
---|---|
oldValue | the old value of the property |
newValue | the new value of the property |
Returns all subscribers. This includes both listeners subscribed to all property changes and listeners subscribed to a single property.
Returns the subscribers to be notified when propertyName
changes.
This includes both listeners subscribed to all property changes and
listeners subscribed to the named property only.
Returns true if there are listeners registered to the property with the given name.
propertyName | the name of the property |
---|
Unsubscribes listener
from change notifications for the property
named propertyName
. If multiple subscriptions exist for listener
, it will receive one fewer notifications when the property
changes. If the property name or listener is null or not subscribed, this
method silently does nothing.
Unsubscribes listener
from change notifications for all
properties. If the listener has multiple subscriptions, it will receive
one fewer notification when properties change. If the property name or
listener is null or not subscribed, this method silently does nothing.