bibliothek.gui.dock.action.dropdown
Class DefaultDropDownFilter

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

public class DefaultDropDownFilter
extends AbstractDropDownFilter

An implementation of DropDownFilter. This filter uses the contents of the selected element whenever possible. The tooltip either consists of the drop-down-action if the selected action is not triggerable, or of the action itself if it is triggerable.

Author:
Benjamin Sigg

Field Summary
static DropDownFilterFactory FACTORY
          A factory for this type of filter
 
Fields inherited from class bibliothek.gui.dock.action.dropdown.AbstractDropDownFilter
disabledIcon, enabled, icon, selected, text, tooltip
 
Constructor Summary
DefaultDropDownFilter(DropDownAction action, Dockable dockable, DropDownView view)
          Creates a new filter
 
Method Summary
 void update(DropDownViewItem selection)
          Updates all properties using the current selection of a button.
protected  void updateDisabledIcon(DropDownViewItem selection)
          Updates the disabled icon of the view.
protected  void updateEnabled(DropDownViewItem selection)
          Updates the enabled-state of the view.
protected  void updateIcon(DropDownViewItem selection)
          Updates the icon of the view.
protected  void updateSelected(DropDownViewItem selection)
          Updates the selected-state of the view.
protected  void updateText(DropDownViewItem selection)
          Updates the text of the view.
protected  void updateTooltip(DropDownViewItem selection)
          Updates the tooltip of the view.
 
Methods inherited from class bibliothek.gui.dock.action.dropdown.AbstractDropDownFilter
setDisabledIcon, setEnabled, setIcon, setSelected, setText, setTooltip
 
Methods inherited from class bibliothek.gui.dock.action.dropdown.DropDownFilter
bind, getAction, getDockable, getView, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY

public static final DropDownFilterFactory FACTORY
A factory for this type of filter

Constructor Detail

DefaultDropDownFilter

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

Parameters:
action - the action to filter
dockable - the owner of action
view - the view where this filter will write into
Method Detail

update

public void update(DropDownViewItem selection)
Description copied from class: DropDownFilter
Updates all properties using the current selection of a button.

Specified by:
update in class DropDownFilter
Parameters:
selection - the selection

updateEnabled

protected void updateEnabled(DropDownViewItem selection)
Updates the enabled-state of the view.

Parameters:
selection - the selected item, ignored by the default implementation

updateSelected

protected void updateSelected(DropDownViewItem selection)
Updates the selected-state of the view.

Parameters:
selection - the selected item, ignored by the default implementation

updateIcon

protected void updateIcon(DropDownViewItem selection)
Updates the icon of the view.

Parameters:
selection - the selected item, ignored by the default implementation

updateDisabledIcon

protected void updateDisabledIcon(DropDownViewItem selection)
Updates the disabled icon of the view.

Parameters:
selection - the selected item, ignored by the default implementation

updateText

protected void updateText(DropDownViewItem selection)
Updates the text of the view.

Parameters:
selection - the selected item, ignored by the default implementation

updateTooltip

protected void updateTooltip(DropDownViewItem selection)
Updates the tooltip of the view.

Parameters:
selection - the selected item, ignored by the default implementation