Interface PropertyConstrainable
- All Known Subinterfaces:
SequenceTask
,Task
- All Known Implementing Classes:
AbstractIOKit
,AbstractOperation
,AbstractReadWriteLockOperation
,AbstractSequenceTask
,AbstractTask
,AbstractViewIOKit
,BoundPropertyObject
,BoundPropertyResource
,DefaultModifiable
,DefaultObjectState
,DefaultURIAccessible
,ModelViewIOKit
,ModifiableCollection
,ModifiableSet
,ResourceModel
,RunnableOperation
,TextIOKit
,URIAccessibleModel
- Author:
- Garret Wilson
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a vetoable listener to the listener list.void
addVetoableChangeListener
(String propertyName, VetoableChangeListener listener) Adds a vetoable change listener for a specific property.Returns the list of vetoable change listeners.getVetoableChangeListeners
(String propertyName) Returns an array of all the listeners which have been associated with the named property.boolean
hasVetoableChangeListeners
(String propertyName) Checks if there are any vetoable change listeners for a specific property, including those registered on all properties.void
Removes a vetoable change listener from the listener list.void
removeVetoableChangeListener
(String propertyName, VetoableChangeListener listener) Removes a vetoable change listener for a specific property.
-
Method Details
-
addVetoableChangeListener
Adds a vetoable listener to the listener list. The listener is registered for all properties.The same listener object may be added more than once, and will be called as many times as it is added.
If
listener
isnull
, no exception is thrown and no action is taken.- Parameters:
listener
- TheVetoableChangeListener
to be added.
-
removeVetoableChangeListener
Removes a vetoable change listener from the listener list. This removes a VetoableChangeListener that was registered for all properties.If
listener
was added more than once to the same event source, it will be notified one less time after being removed.If
listener
isnull
, or was never added, no exception is thrown and no action is taken.- Parameters:
listener
- TheVetoableChangeListener
to be removed
-
addVetoableChangeListener
Adds a vetoable change listener for a specific property. The listener will be invoked only when a call toBoundPropertyObject.fireVetoableChange(String, int, int)
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.
If
propertyName
orlistener
isnull
, no exception is thrown and no action is taken.- Parameters:
propertyName
- The name of the property to listen on.listener
- TheVetoableChangeListener
to be added.
-
removeVetoableChangeListener
Removes a vetoable change listener for a specific property.If
listener
was added more than once to the same event source for the specified property, it will be notified one less time after being removed.If
propertyName
isnull
, no exception is thrown and no action is taken.If
listener
isnull
, 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
- TheVetoableChangeListener
to be removed.
-
getVetoableChangeListeners
VetoableChangeListener[] getVetoableChangeListeners()Returns the list of vetoable change listeners. If named vetoable change listeners were added, thenVetoableChangeListenerProxy
wrappers will returned.- Returns:
- All added vetoable change listeners, including vetoable change listener proxys if named vetoable change listeners were added.
-
getVetoableChangeListeners
Returns an array of all the listeners which have been associated with the named property.- Parameters:
propertyName
- The name of the property being listened to.- Returns:
- All the
VetoableChangeListeners
associated with the named property; if no such listeners have been added, or ifpropertyName
isnull
, an empty array is returned.
-
hasVetoableChangeListeners
Checks if there are any vetoable change listeners for a specific property, including those registered on all properties. IfpropertyName
isnull
, this method only checks for listeners registered on all properties.- Parameters:
propertyName
- The property name.- Returns:
true
if there are one or more listeners for the given property.
-