Interface PropertySupport

All Known Implementing Classes:
ConcurrentPropertySupport

public interface PropertySupport
An interface for handling PropertyListeners. PropertyContainers may delegate listener handling to instances of this class.
Since:
3.2.0
Author:
Joel Uckelman
  • Method Details

    • addPropertyListener

      void addPropertyListener(PropertyListener<Object> listener)
      Adds a listener for all changes.
      Parameters:
      listener - the listener to add
    • removePropertyListener

      void removePropertyListener(PropertyListener<Object> listener)
      Removes a listener for all changes.
      Parameters:
      listener - the listener to remove
    • hasListeners

      boolean hasListeners()
      Checks whether there are PropertyListeners for all changes.
      Returns:
      true if there are listeners
    • getPropertyListeners

      List<PropertyListener<Object>> getPropertyListeners()
      Returns a list of PropertyListeners listening to all changes.
      Returns:
      a list of listeners
    • addPropertyListener

      <T> void addPropertyListener(Property<T> prop, PropertyListener<? super T> listener)
      Adds a listener for a specific Property.
      Parameters:
      prop - the Property to listen on
      listener - the listener to add
    • removePropertyListener

      <T> void removePropertyListener(Property<T> prop, PropertyListener<? super T> listener)
      Removes a listener for a specific Property.
      Parameters:
      prop - the Property listened on
      listener - the listener to remove
    • getPropertyListeners

      <T> List<PropertyListener<? super T>> getPropertyListeners(Property<T> prop)
      Returns a list of PropertyListeners listening to a given Property.
      Parameters:
      prop - the Property listened on
      Returns:
      a list of listeners
    • hasListeners

      <T> boolean hasListeners(Property<T> prop)
      Checks whether there are PropertyListeners for a given Property.
      Returns:
      true if there are listeners for the given property
    • fireChanged

      <T> void fireChanged(Object src, Property<T> prop, T oldVal, T newVal)
      Notifies listeners of a property change.
      Parameters:
      src - the source of the change
      prop - the changed Property
      oldVal - the old value of the Property
      newVal - the new value of the Property