bibliothek.gui.dock.action.dropdown
Class AbstractDropDownFilter

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

public abstract class AbstractDropDownFilter
extends DropDownFilter

A DropDownFilter which stores all properties. The properties can be read by subclasses.

Author:
Benjamin Sigg

Field Summary
protected  boolean enabled
          whether the selected element is enabled
protected  Map<ActionContentModifier,Icon> icons
          the icons provided by the selected element
protected  Dockable representative
          the Dockable which is represented by this view
protected  boolean selected
          whether the selected element is selected
protected  String text
          the text of the selected element
protected  String tooltip
          the tooltip of the selected element
 
Constructor Summary
AbstractDropDownFilter(DropDownAction action, Dockable dockable, DropDownView view)
          Creates a new filter.
 
Method Summary
 void clearIcons()
          Clears all Icons, any field pointing to an Icon is set to null
protected  Icon getIcon(ActionContentModifier modifier)
          Gets the icon which was stored using setIcon(ActionContentModifier, Icon).
 void setDockableRepresentation(Dockable dockable)
          Sets the Dockable which is represented by the view.
 void setEnabled(boolean enabled)
          Sets the enabled-state of the button.
 void setIcon(ActionContentModifier modifier, Icon icon)
          Sets the icon of the button.
 void setSelected(boolean selected)
          Sets the selected-state of the button.
 void setText(String text)
          Sets the text of the button.
 void setTooltip(String tooltip)
          Sets the tooltip of the button.
 
Methods inherited from class bibliothek.gui.dock.action.dropdown.DropDownFilter
bind, getAction, getDockable, getView, unbind, update
 
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
getIconContexts
 

Field Detail

icons

protected Map<ActionContentModifier,Icon> icons
the icons provided by the selected element


enabled

protected boolean enabled
whether the selected element is enabled


selected

protected boolean selected
whether the selected element is selected


text

protected String text
the text of the selected element


tooltip

protected String tooltip
the tooltip of the selected element


representative

protected Dockable representative
the Dockable which is represented by this view

Constructor Detail

AbstractDropDownFilter

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

Parameters:
action - the action to filter
dockable - the owner of action.
view - the view in which this action will write its properties
Method Detail

setIcon

public void setIcon(ActionContentModifier modifier,
                    Icon icon)
Description copied from interface: DropDownView
Sets the icon of the button.

Parameters:
modifier - the context in which the icon is used, not null
icon - the icon

clearIcons

public void clearIcons()
Description copied from interface: DropDownView
Clears all Icons, any field pointing to an Icon is set to null


getIcon

protected Icon getIcon(ActionContentModifier modifier)
Gets the icon which was stored using setIcon(ActionContentModifier, Icon).

Parameters:
modifier - the context in which to use the icon
Returns:
the icon or null

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: DropDownView
Sets the enabled-state of the button.

Parameters:
enabled - the state

setSelected

public void setSelected(boolean selected)
Description copied from interface: DropDownView
Sets the selected-state of the button.

Parameters:
selected - the state

setText

public void setText(String text)
Description copied from interface: DropDownView
Sets the text of the button.

Parameters:
text - the text

setTooltip

public void setTooltip(String tooltip)
Description copied from interface: DropDownView
Sets the tooltip of the button.

Parameters:
tooltip - the tooltip

setDockableRepresentation

public void setDockableRepresentation(Dockable dockable)
Description copied from interface: DropDownView
Sets the Dockable which is represented by the view.

Parameters:
dockable - the represented element, can be null