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

public interface PropertyConstrainable
Indicates that an object supports constrained properties and vetoable change listener notification.
Author:
Garret Wilson
  • Method Details

    • addVetoableChangeListener

      void addVetoableChangeListener(VetoableChangeListener listener)
      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 is null, no exception is thrown and no action is taken.

      Parameters:
      listener - The VetoableChangeListener to be added.
    • removeVetoableChangeListener

      void removeVetoableChangeListener(VetoableChangeListener listener)
      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 is null, or was never added, no exception is thrown and no action is taken.

      Parameters:
      listener - The VetoableChangeListener to be removed
    • addVetoableChangeListener

      void addVetoableChangeListener(String propertyName, VetoableChangeListener listener)
      Adds a vetoable change listener for a specific property. The listener will be invoked only when a call to BoundPropertyObject.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 or listener is null, no exception is thrown and no action is taken.

      Parameters:
      propertyName - The name of the property to listen on.
      listener - The VetoableChangeListener to be added.
    • removeVetoableChangeListener

      void removeVetoableChangeListener(String propertyName, VetoableChangeListener listener)
      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 is null, no exception is thrown and no action is taken.

      If listener is 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 VetoableChangeListener to be removed.
    • getVetoableChangeListeners

      VetoableChangeListener[] getVetoableChangeListeners()
      Returns the list of vetoable change listeners. If named vetoable change listeners were added, then VetoableChangeListenerProxy wrappers will returned.
      Returns:
      All added vetoable change listeners, including vetoable change listener proxys if named vetoable change listeners were added.
    • getVetoableChangeListeners

      VetoableChangeListener[] getVetoableChangeListeners(String propertyName)
      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 if propertyName is null, an empty array is returned.
    • hasVetoableChangeListeners

      boolean hasVetoableChangeListeners(String propertyName)
      Checks if there are any vetoable change listeners for a specific property, including those registered on all properties. If propertyName is null, 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.