Class CListenerCollection

java.lang.Object
bibliothek.gui.dock.common.intern.CListenerCollection

public class CListenerCollection extends Object
A collection of the listeners which are normally added to a CDockable. This class can be used by subclasses of CDockable to easily store listeners and fire events.
Author:
Benjamin Sigg
  • Constructor Details

    • CListenerCollection

      public CListenerCollection()
  • Method Details

    • addCDockableStateListener

      public void addCDockableStateListener(CDockableStateListener listener)
      Stores an additional CDockableStateListener in this collection.
      Parameters:
      listener - the additional listener
    • removeCDockableStateListener

      public void removeCDockableStateListener(CDockableStateListener listener)
      Removes a listener from this collection
      Parameters:
      listener - the listener to remove
    • getCDockableStateListeners

      public CDockableStateListener[] getCDockableStateListeners()
      Gets all currently registered CDockableStateListeners collected in an array. Modifications of the array will not modify this collection.
      Returns:
      the independent array of listeners
    • getCDockableLocationListener

      public CDockableLocationListener getCDockableLocationListener()
      Gets a CDockableLocationListener which forwards all calls to its methods to the listeners registered at this collection.
      Returns:
      a forwarding listener
    • hasCDockableLocationListeners

      public boolean hasCDockableLocationListeners()
      Tells whether at least one CDockableStateListener is currently registered.
      Returns:
      true if there is at least one listener
    • addCDockableLocationListener

      public void addCDockableLocationListener(CDockableLocationListener listener)
      Stores an additional CDockableLocationListener in this collection.
      Parameters:
      listener - the additional listener
    • removeCDockableLocationListener

      public void removeCDockableLocationListener(CDockableLocationListener listener)
      Removes a listener from this collection
      Parameters:
      listener - the listener to remove
    • getCDockableLocationListeners

      public CDockableLocationListener[] getCDockableLocationListeners()
      Gets all currently registered CDockableLocationListeners collected in an array. Modifications of the array will not modify this collection.
      Returns:
      the independent array of listeners
    • getCDockableStateListener

      public CDockableStateListener getCDockableStateListener()
      Gets a CDockableStateListener which forwards all calls to its methods to the listeners registered at this collection.
      Returns:
      a forwarding listener
    • addCDockablePropertyListener

      public void addCDockablePropertyListener(CDockablePropertyListener listener)
      Stores an additional CDockablePropertyListener in this collection.
      Parameters:
      listener - the additional listener
    • removeCDockablePropertyListener

      public void removeCDockablePropertyListener(CDockablePropertyListener listener)
      Removes a listener from this collection.
      Parameters:
      listener - the listener to remove
    • getCDockablePropertyListeners

      public CDockablePropertyListener[] getCDockablePropertyListeners()
      Gets all currently registered CDockableStateListeners collected in an array. Modifications of the array will not modify this collection.
      Returns:
      the independent array of listeners
    • getCDockablePropertyListener

      public CDockablePropertyListener getCDockablePropertyListener()
      Gets a CDockablePropertyListener which forwards all calls to its methods to the listeners registered at this collection.
      Returns:
      a forwarding listener
    • addFocusListener

      public void addFocusListener(CFocusListener listener)
      Adds a CFocusListener to this collection.
      Parameters:
      listener - the new listener
    • removeFocusListener

      public void removeFocusListener(CFocusListener listener)
      Removes a listener from this collection.
      Parameters:
      listener - the listener to remove
    • getFocusListeners

      public CFocusListener[] getFocusListeners()
      Gets all currently registered CFocusListeners collected in an array. Modifications of the array will not modify this collection.
      Returns:
      the independent array of listeners
    • getFocusListener

      public CFocusListener getFocusListener()
      Gets a CFocusListener which forwards all calls to its methods to the listener registered at this collection.
      Returns:
      a forwarding listener
    • addVetoFocusListener

      public void addVetoFocusListener(CVetoFocusListener listener)
      Adds a listener to this collection.
      Parameters:
      listener - the additional listener
    • removeVetoFocusListener

      public void removeVetoFocusListener(CVetoFocusListener listener)
      Removes a listener from this collection
      Parameters:
      listener - the listener to remove
    • getVetoFocusListeners

      public CVetoFocusListener[] getVetoFocusListeners()
      Gets all the CVetoFocusListener that are collected in this collection.
      Returns:
      an independent array of listeners
    • getVetoFocusListener

      public CVetoFocusListener getVetoFocusListener()
      Gets a CVetoFocusListener which forwards all calls to its methods to the listeners registered in this collection.
      Returns:
      a forwarding listener
    • addKeyboardListener

      public void addKeyboardListener(CKeyboardListener listener)
      Stores an additional CKeyboardListener in this collection.
      Parameters:
      listener - the new listener
    • removeKeyboardListener

      public void removeKeyboardListener(CKeyboardListener listener)
      Removes a listener from this collection.
      Parameters:
      listener - the listener to remove
    • getKeyboardListeners

      public CKeyboardListener[] getKeyboardListeners()
      Gets all currently registered CKeyboardListeners collected in an array. Modifications of the array will not modify this collection.
      Returns:
      the independent array of listeners
    • getKeyboardListener

      public CKeyboardListener getKeyboardListener()
      Gets a CKeyboardListener which forwards all calls to its methods to the listener registered at this collection.
      Returns:
      a forwarding listener
    • addDoubleClickListener

      public void addDoubleClickListener(CDoubleClickListener listener)
      Stores an additional CDoubleClickListener in this collection.
      Parameters:
      listener - the additional listener
    • removeDoubleClickListener

      public void removeDoubleClickListener(CDoubleClickListener listener)
      Removes a listener from this collection.
      Parameters:
      listener - the listener to remove
    • getDoubleClickListeners

      public CDoubleClickListener[] getDoubleClickListeners()
      Gets all currently registered CDoubleClickListeners collected in an array. Modifications of the array will not modify this collection.
      Returns:
      the independent array of listeners
    • getDoubleClickListener

      public CDoubleClickListener getDoubleClickListener()
      Gets a CDoubleClickListener which forwards all calls to its methods to the listener registered at this collection.
      Returns:
      a forwarding listener
    • getVetoClosingListener

      public CVetoClosingListener getVetoClosingListener()
      Gets a CVetoClosingListener that forwards all events to the other registered listeners.
      Returns:
      the forwarding listener
    • addVetoClosingListener

      public void addVetoClosingListener(CVetoClosingListener listener)
      Stores an additional CVetoClosingListener in this collection.
      Parameters:
      listener - the new listener
    • removeVetoClosingListener

      public void removeVetoClosingListener(CVetoClosingListener listener)
      Removes listener from this collection.
      Parameters:
      listener - the listener to remove
    • hasVetoClosingListeners

      public boolean hasVetoClosingListeners()
      Tells whether there is at least one CVetoClosingListener registered in this collection.
      Returns:
      whether there is at least one listener
    • getVetoClosingListeners

      public CVetoClosingListener[] getVetoClosingListeners()
      Gets all currently registered CVetoClosingListeners collected in an array. Modifications of the array will not modify this collection.
      Returns:
      the independent array of listeners