bibliothek.gui.dock.action.dropdown
Class DropDownFilter

java.lang.Object
  extended by bibliothek.gui.dock.action.dropdown.DropDownFilter
All Implemented Interfaces:
DropDownView
Direct Known Subclasses:
AbstractDropDownFilter

public abstract class DropDownFilter
extends java.lang.Object
implements DropDownView

A filter is used by views which want to display a DropDownAction, but have to show elements of the selected action as well.
A filter is a DropDownView which forwards their properties to another DropDownView. The filter may cache some values, but has to forward them if the update-method is invoked.

Author:
Benjamin Sigg

Constructor Summary
DropDownFilter(Dockable dockable, DropDownAction action, DropDownView view)
          Creates a new filter
 
Method Summary
 void bind()
          Invoked before this filter is used
 DropDownAction getAction()
          Gets the action that is filtered.
 Dockable getDockable()
          Gets the Dockable for which the action is shown.
 DropDownView getView()
          Gets a DropDownView in which this filter has to write its properties when update(DropDownViewItem) is invoked.
 void unbind()
          Invoked when this filter is no longer used
abstract  void update(DropDownViewItem selection)
          Updates all properties using the current selection of a button.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.action.dropdown.DropDownView
setDisabledIcon, setDockableRepresentation, setEnabled, setIcon, setSelected, setText, setTooltip
 

Constructor Detail

DropDownFilter

public DropDownFilter(Dockable dockable,
                      DropDownAction action,
                      DropDownView view)
Creates a new filter

Parameters:
dockable - the owner of the view
action - the action that is filtered
view - a view where this filter should write into
Method Detail

getDockable

public Dockable getDockable()
Gets the Dockable for which the action is shown.

Returns:
the owner of the action

getAction

public DropDownAction getAction()
Gets the action that is filtered.

Returns:
the action

getView

public DropDownView getView()
Gets a DropDownView in which this filter has to write its properties when update(DropDownViewItem) is invoked. The view should be seen as a thing like a button or a menu item.

Returns:
the view to write into

bind

public void bind()
Invoked before this filter is used


unbind

public void unbind()
Invoked when this filter is no longer used


update

public abstract void update(DropDownViewItem selection)
Updates all properties using the current selection of a button.

Parameters:
selection - the selection