bibliothek.gui.dock.station.stack.tab
Class AbstractTabContentFilter

java.lang.Object
  extended by bibliothek.gui.dock.station.stack.tab.AbstractTabContentFilter
All Implemented Interfaces:
TabContentFilter
Direct Known Subclasses:
DefaultTabContentFilter

public abstract class AbstractTabContentFilter
extends java.lang.Object
implements TabContentFilter

An abstract implementation of TabContentFilter, knows which StackDockStations and which Dockables are currently filtered.
Subclasses may override added, removed, deselected and selected to be informed if the contents of a StackDockStation changed.
Note that this filter does not observe whether elements are added or removed from a StackDockComponent.

Author:
Benjamin Sigg

Field Summary
protected  java.util.List<StackDockComponent> components
          all the components that are currently installed
protected  java.util.List<StackDockStation> stations
          all stations that are currently installed
 
Constructor Summary
AbstractTabContentFilter()
           
 
Method Summary
protected  void added(StackDockStation station, Dockable dockable)
          Called when dockable is added to station, this method is called before the dock parent of dockable is set.
 void addListener(TabContentFilterListener listener)
          Adds a listener to this filter.
protected  void deselected(StackDockStation station, Dockable dockable)
          Called when the selection of station changed to another dockable than oldSelection.
 TabContent filter(TabContent content, StackDockComponent component, Dockable dockable)
          This implementation just returns content.
 TabContent filter(TabContent content, StackDockStation station, Dockable dockable)
          This implementation just returns content.
protected  void fireChanged()
          Calls TabContentFilterListener.contentChanged() on all listeners that are currently installed.
protected  void fireChanged(Dockable dockable)
          Calls TabContentFilterListener.contentChanged(Dockable) on all listeners that are currently installed.
protected  void fireChanged(StackDockComponent component)
          Calls TabContentFilterListener.contentChanged(StackDockComponent) on all listeners that are currently installed.
protected  void fireChanged(StackDockStation station)
          Calls TabContentFilterListener.contentChanged(StackDockStation) on all listeners that are currently installed.
 void install(StackDockComponent component)
          Informs this filter that it will be used by component.
 void install(StackDockStation station)
          Informs this filter that it will be used by station.
protected  TabContentFilterListener[] listeners()
          Gets all listeners that are currently observing this filter.
protected  void removed(StackDockStation station, Dockable dockable)
          Called when dockable has been removed from station.
 void removeListener(TabContentFilterListener listener)
          Removes a listener from this filter.
protected  void selected(StackDockStation station, Dockable dockable)
          Called when the selection of station changed to newSelection.
protected  void selectionChanged(StackDockComponent component)
          Called if the selection of component changed.
 void uninstall(StackDockComponent component)
          Informs this filter that it is no longer used by component.
 void uninstall(StackDockStation station)
          Informs this filter that it is no longer used by station.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stations

protected java.util.List<StackDockStation> stations
all stations that are currently installed


components

protected java.util.List<StackDockComponent> components
all the components that are currently installed

Constructor Detail

AbstractTabContentFilter

public AbstractTabContentFilter()
Method Detail

addListener

public void addListener(TabContentFilterListener listener)
Description copied from interface: TabContentFilter
Adds a listener to this filter. The listener can be called if this filter changes its behavior.

Specified by:
addListener in interface TabContentFilter
Parameters:
listener - the new listener, not null

removeListener

public void removeListener(TabContentFilterListener listener)
Description copied from interface: TabContentFilter
Removes a listener from this filter.

Specified by:
removeListener in interface TabContentFilter
Parameters:
listener - the listener to remove

listeners

protected TabContentFilterListener[] listeners()
Gets all listeners that are currently observing this filter.

Returns:
the new listener

fireChanged

protected void fireChanged()
Calls TabContentFilterListener.contentChanged() on all listeners that are currently installed.


fireChanged

protected void fireChanged(Dockable dockable)
Calls TabContentFilterListener.contentChanged(Dockable) on all listeners that are currently installed.

Parameters:
dockable - the element whose content changed

fireChanged

protected void fireChanged(StackDockStation station)
Calls TabContentFilterListener.contentChanged(StackDockStation) on all listeners that are currently installed.

Parameters:
station - the station whose content changed

fireChanged

protected void fireChanged(StackDockComponent component)
Calls TabContentFilterListener.contentChanged(StackDockComponent) on all listeners that are currently installed.

Parameters:
component - the component whose content changed

install

public void install(StackDockStation station)
Description copied from interface: TabContentFilter
Informs this filter that it will be used by station.

Specified by:
install in interface TabContentFilter
Parameters:
station - a new client

install

public void install(StackDockComponent component)
Description copied from interface: TabContentFilter
Informs this filter that it will be used by component. Note that this method may not be called if the component itself is used by a StackDockStation.

Specified by:
install in interface TabContentFilter
Parameters:
component - a new client

uninstall

public void uninstall(StackDockStation station)
Description copied from interface: TabContentFilter
Informs this filter that it is no longer used by station.

Specified by:
uninstall in interface TabContentFilter
Parameters:
station - an old client

uninstall

public void uninstall(StackDockComponent component)
Description copied from interface: TabContentFilter
Informs this filter that it is no longer used by component.

Specified by:
uninstall in interface TabContentFilter
Parameters:
component - the old component

filter

public TabContent filter(TabContent content,
                         StackDockStation station,
                         Dockable dockable)
This implementation just returns content.

Specified by:
filter in interface TabContentFilter
Parameters:
content - the default content to use, not null
station - the station which calls this method
dockable - the element which is displayed
Returns:
the content to show, may be null

filter

public TabContent filter(TabContent content,
                         StackDockComponent component,
                         Dockable dockable)
This implementation just returns content.

Specified by:
filter in interface TabContentFilter
Parameters:
content - the default content to use, not null
component - the component which calls this method
dockable - the element which is displayed
Returns:
the content to show, may be null

added

protected void added(StackDockStation station,
                     Dockable dockable)
Called when dockable is added to station, this method is called before the dock parent of dockable is set.

Parameters:
station - the new parent of dockable
dockable - the new child

removed

protected void removed(StackDockStation station,
                       Dockable dockable)
Called when dockable has been removed from station.

Parameters:
station - the old parent of dockable
dockable - the removed element

selected

protected void selected(StackDockStation station,
                        Dockable dockable)
Called when the selection of station changed to newSelection.

Parameters:
station - the owner of newSelection
dockable - the new selection, not null

deselected

protected void deselected(StackDockStation station,
                          Dockable dockable)
Called when the selection of station changed to another dockable than oldSelection.

Parameters:
station - the owner of oldSelection
dockable - the old selection, not null

selectionChanged

protected void selectionChanged(StackDockComponent component)
Called if the selection of component changed.

Parameters:
component - the component whose selection changed