bibliothek.gui.dock.themes.basic.action.dropdown
Interface DropDownViewItem

All Superinterfaces:
MenuViewItem<JComponent>, ViewItem<JComponent>
All Known Implementing Classes:
AbstractDropDownHandler, ButtonDropDownHandler, SelectableDropDownHandler, SubDropDownHandler

public interface DropDownViewItem
extends MenuViewItem<JComponent>

An item that is shown in the menu of a drop-down-button and can be selected by the button. Normally a DropDownViewItem is a wrapper for some DockAction, although there may exist exceptions.

Author:
Benjamin Sigg

Method Summary
 boolean isSelectable()
          Tells whether this item can be selected by the button.
 boolean isTriggerable(boolean selected)
          Tells whether the item can be triggered if it is on the button or in the menu.
 void setView(DropDownView view)
          Sends the current settings of this item to the view.
 void triggered()
          Invoked if the item is triggered from outside.
 
Methods inherited from interface bibliothek.gui.dock.themes.basic.action.menu.MenuViewItem
addActionListener, removeActionListener
 
Methods inherited from interface bibliothek.gui.dock.action.view.ViewItem
bind, getAction, getItem, unbind
 

Method Detail

triggered

void triggered()
Invoked if the item is triggered from outside. The item should call the method of its action that causes the action to execute its natural code (for example: a checkbox may change its selected-state).


setView

void setView(DropDownView view)
Sends the current settings of this item to the view. The values can be changed as long as the view is registered.

Parameters:
view - the view, might be null

isSelectable

boolean isSelectable()
Tells whether this item can be selected by the button. Only selectable items can be shown directly on the button. Some items, like a separator, should return false.

Returns:
whether the item can be selected

isTriggerable

boolean isTriggerable(boolean selected)
Tells whether the item can be triggered if it is on the button or in the menu.

Parameters:
selected - if true, then this item is currently shown directly on the main button, otherwise it is in the drop-down menu.
Returns:
true if the item can be triggered