java.beans
public class VetoableChangeSupport extends Object implements Serializable
Since: 1.1
UNKNOWN: updated to 1.4
Constructor Summary | |
---|---|
VetoableChangeSupport(Object source)
Create a VetoableChangeSupport to work with a specific source bean.
|
Method Summary | |
---|---|
void | addVetoableChangeListener(VetoableChangeListener l)
Adds a VetoableChangeListener to the list of global listeners. |
void | addVetoableChangeListener(String propertyName, VetoableChangeListener l)
Adds a VetoableChangeListener listening on the specified property. |
void | fireVetoableChange(String propertyName, Object oldVal, Object newVal)
Fire a PropertyChangeEvent containing the old and new values of the
property to all the global listeners, and to all the listeners for the
specified property name. |
void | fireVetoableChange(String propertyName, int oldVal, int newVal)
Fire a PropertyChangeEvent containing the old and new values of the
property to all the global listeners, and to all the listeners for the
specified property name. |
void | fireVetoableChange(String propertyName, boolean oldVal, boolean newVal)
Fire a PropertyChangeEvent containing the old and new values of the
property to all the global listeners, and to all the listeners for the
specified property name. |
void | fireVetoableChange(PropertyChangeEvent event)
Fire a PropertyChangeEvent to all the global listeners, and to all the
listeners for the specified property name. |
VetoableChangeListener[] | getVetoableChangeListeners()
Returns an array of all registered vetoable change listeners. |
VetoableChangeListener[] | getVetoableChangeListeners(String propertyName)
Returns an array of all vetoable change listeners registered under the
given property name. |
boolean | hasListeners(String propertyName)
Tell whether the specified property is being listened on or not. |
void | removeVetoableChangeListener(VetoableChangeListener l)
Removes a VetoableChangeListener from the list of global listeners. |
void | removeVetoableChangeListener(String propertyName, VetoableChangeListener l)
Removes a VetoableChangeListener from listening to a specific property.
|
Parameters: source the source bean to use
Throws: NullPointerException if source is null
Parameters: l the listener to add (null
ignored).
Parameters: propertyName the name of the property to listen on l the listener to add
Parameters: propertyName the name of the property that changed oldVal the old value newVal the new value
Throws: PropertyVetoException if the change is vetoed by a listener
Parameters: propertyName the name of the property that changed oldVal the old value newVal the new value
Throws: PropertyVetoException if the change is vetoed by a listener
Parameters: propertyName the name of the property that changed oldVal the old value newVal the new value
Throws: PropertyVetoException if the change is vetoed by a listener
Parameters: event the event to fire
Throws: NullPointerException if event is null PropertyVetoException if the change is vetoed by a listener
VetoableChangeListenerProxy
, so you must check whether the
listener is an instance of the proxy class in order to see what name the
real listener is registered under. If there are no registered listeners,
this returns an empty array.
Returns: the array of registered listeners
Since: 1.4
See Also: VetoableChangeListenerProxy
Returns: the array of registered listeners
Throws: NullPointerException if propertyName is null
Since: 1.4
true
if there are listeners on all
properties or if there is a listener specifically on this property.
Parameters: propertyName the property that may be listened on
Returns: whether the property is being listened on
Throws: NullPointerException if propertyName is null
add()
has been called multiple times for a
particular listener, remove()
will have to be called the
same number of times to deregister it. This method will unwrap a
VetoableChangeListenerProxy, removing the underlying delegate from the
named property list.
Parameters: l the listener to remove
add()
has been called multiple times for a particular
listener on a property, remove()
will have to be called the
same number of times to deregister it. This method will unwrap a
VetoableChangeListenerProxy, removing the underlying delegate from the
named property list if the names match.
Parameters: propertyName the property to stop listening on l the listener to remove
Throws: NullPointerException if propertyName is null