bibliothek.gui.dock.station.toolbar.menu
Class EagerCustomizationToolbarButton

java.lang.Object
  extended by bibliothek.gui.dock.station.toolbar.menu.CustomizationToolbarButton
      extended by bibliothek.gui.dock.station.toolbar.menu.EagerCustomizationToolbarButton
All Implemented Interfaces:
CustomizationMenuContent

public class EagerCustomizationToolbarButton
extends CustomizationToolbarButton

A CustomizationToolbarButton which uses an already existing Dockable to gain access to icon and description.

Author:
Benjamin Sigg

Nested Class Summary
 
Nested classes/interfaces inherited from class bibliothek.gui.dock.station.toolbar.menu.CustomizationToolbarButton
CustomizationToolbarButton.ItemLocation
 
Constructor Summary
EagerCustomizationToolbarButton(bibliothek.gui.Dockable dockable)
          Creates a new button, a DockableListener is added to dockable to read icon and description.
 
Method Summary
 void bind(CustomizationMenuCallback callback)
          Informs this item that is going to be used.
protected  bibliothek.gui.Dockable getDockable()
          Gets the element that is put onto a toolbar.
protected  boolean hasDockable()
          Tells whether the Dockable of this button, accessible by calling CustomizationToolbarButton.getDockable(), is already present.
 void unbind()
          Informs this item that it is no longer used.
 
Methods inherited from class bibliothek.gui.dock.station.toolbar.menu.CustomizationToolbarButton
getItemLocation, getView, setController, setDescription, setIcon, setItemVisible, setText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EagerCustomizationToolbarButton

public EagerCustomizationToolbarButton(bibliothek.gui.Dockable dockable)
Creates a new button, a DockableListener is added to dockable to read icon and description.

Parameters:
dockable - the item represented by this button
Method Detail

hasDockable

protected boolean hasDockable()
Description copied from class: CustomizationToolbarButton
Tells whether the Dockable of this button, accessible by calling CustomizationToolbarButton.getDockable(), is already present. If the item is not yet present, then it cannot be visible or selected at this time.

Specified by:
hasDockable in class CustomizationToolbarButton
Returns:
whether the Dockable already exists

getDockable

protected bibliothek.gui.Dockable getDockable()
Description copied from class: CustomizationToolbarButton
Gets the element that is put onto a toolbar. This method may create the Dockable lazily in the very moment it is used the first time.

Specified by:
getDockable in class CustomizationToolbarButton
Returns:
the item to show on the toolbar

bind

public void bind(CustomizationMenuCallback callback)
Description copied from interface: CustomizationMenuContent
Informs this item that is going to be used. This method must not be called twice in a row.

Specified by:
bind in interface CustomizationMenuContent
Overrides:
bind in class CustomizationToolbarButton
Parameters:
callback - access to more detailed information about the DockStation that is showing the menu

unbind

public void unbind()
Description copied from interface: CustomizationMenuContent
Informs this item that it is no longer used. This method must not be called twive in a row, it must be called after a call to #bind().

Specified by:
unbind in interface CustomizationMenuContent
Overrides:
unbind in class CustomizationToolbarButton