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

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

public class DefaultTabContentFilter
extends AbstractTabContentFilter

This TabContentFilter offers a set of predefined behavioral patterns.

Author:
Benjamin Sigg

Nested Class Summary
static class DefaultTabContentFilter.Behavior
          Tells a DefaultTabContentFilter how it behaves.
 
Field Summary
 
Fields inherited from class bibliothek.gui.dock.station.stack.tab.AbstractTabContentFilter
components, stations
 
Constructor Summary
DefaultTabContentFilter()
          Creates a new filter using the behavior DefaultTabContentFilter.Behavior.ALL.
DefaultTabContentFilter(DefaultTabContentFilter.Behavior behavior)
          Creates a new filter.
DefaultTabContentFilter(DefaultTabContentFilter.Behavior selected, DefaultTabContentFilter.Behavior deselected)
          Creates a new filter.
 
Method Summary
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.
 DefaultTabContentFilter.Behavior getDeselected()
          Gets the behavior that is applied to unselected elements.
 DefaultTabContentFilter.Behavior getSelected()
          Gets the behavior that is applied to selected elements.
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 setDeselected(DefaultTabContentFilter.Behavior deselected)
          Sets the behavior that should be applied on an unselected element.
 void setSelected(DefaultTabContentFilter.Behavior selected)
          Sets the behavior that should be applied on a selected element.
 
Methods inherited from class bibliothek.gui.dock.station.stack.tab.AbstractTabContentFilter
added, addListener, fireChanged, fireChanged, fireChanged, fireChanged, install, install, listeners, removed, removeListener, uninstall, uninstall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTabContentFilter

public DefaultTabContentFilter()
Creates a new filter using the behavior DefaultTabContentFilter.Behavior.ALL.


DefaultTabContentFilter

public DefaultTabContentFilter(DefaultTabContentFilter.Behavior behavior)
Creates a new filter.

Parameters:
behavior - the behavior applied to all elements

DefaultTabContentFilter

public DefaultTabContentFilter(DefaultTabContentFilter.Behavior selected,
                               DefaultTabContentFilter.Behavior deselected)
Creates a new filter.

Parameters:
selected - the behavior applied to selected elements
deselected - the behavior applied to unselected elements
Method Detail

setSelected

public void setSelected(DefaultTabContentFilter.Behavior selected)
Sets the behavior that should be applied on a selected element.

Parameters:
selected - the new behavior, not null

getSelected

public DefaultTabContentFilter.Behavior getSelected()
Gets the behavior that is applied to selected elements.

Returns:
the behavior, not null

setDeselected

public void setDeselected(DefaultTabContentFilter.Behavior deselected)
Sets the behavior that should be applied on an unselected element.

Parameters:
deselected - the new behavior, not null

getDeselected

public DefaultTabContentFilter.Behavior getDeselected()
Gets the behavior that is applied to unselected elements.

Returns:
the behavior, not null

filter

public TabContent filter(TabContent content,
                         StackDockStation station,
                         Dockable dockable)
Description copied from class: AbstractTabContentFilter
This implementation just returns content.

Specified by:
filter in interface TabContentFilter
Overrides:
filter in class AbstractTabContentFilter
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)
Description copied from class: AbstractTabContentFilter
This implementation just returns content.

Specified by:
filter in interface TabContentFilter
Overrides:
filter in class AbstractTabContentFilter
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

selected

protected void selected(StackDockStation station,
                        Dockable dockable)
Description copied from class: AbstractTabContentFilter
Called when the selection of station changed to newSelection.

Overrides:
selected in class AbstractTabContentFilter
Parameters:
station - the owner of newSelection
dockable - the new selection, not null

deselected

protected void deselected(StackDockStation station,
                          Dockable dockable)
Description copied from class: AbstractTabContentFilter
Called when the selection of station changed to another dockable than oldSelection.

Overrides:
deselected in class AbstractTabContentFilter
Parameters:
station - the owner of oldSelection
dockable - the old selection, not null

selectionChanged

protected void selectionChanged(StackDockComponent component)
Description copied from class: AbstractTabContentFilter
Called if the selection of component changed.

Overrides:
selectionChanged in class AbstractTabContentFilter
Parameters:
component - the component whose selection changed