bibliothek.gui.dock
Interface ToolbarItem

All Known Implementing Classes:
ComponentItem, DockActionItem

public interface ToolbarItem

A ToolbarItem is an item that is shown as part of a toolbar. ToolbarItems must be wrapped into a ToolbarItemDockable to be shown.

Author:
Benjamin Sigg

Method Summary
 void addMouseInputListener(MouseInputListener listener)
          Urges this item to add listener to its component.
 void bind()
          Informs this item that it is now in use, the result of getComponent() must not be null and must not change after this method has been called.
 Component getComponent()
          Gets the Component which is wrapped by this item.
 void removeMouseInputListener(MouseInputListener listener)
          Urges this item to remove listener from its component.
 void setController(bibliothek.gui.DockController controller)
          Informs this item about the DockController in whose realm it is used.
 void setDockable(ToolbarItemDockable dockable)
          Informs this item about the Dockable that is using it.
 void setOrientation(Orientation orientation)
          Tells this item the orientation of the toolbar
 void setSelected(boolean selected)
          Informs this item whether it is actually shown or not.
 void unbind()
          Informs this item that it is no longer in use, the result of getComponent() can be null or change after this method has been called.
 

Method Detail

getComponent

Component getComponent()
Gets the Component which is wrapped by this item. The result of this method must not be null after bind() has been called, it may not change until unbind() was called.

Returns:
the wrapped Component, can be null unless bind() was called

bind

void bind()
Informs this item that it is now in use, the result of getComponent() must not be null and must not change after this method has been called.


unbind

void unbind()
Informs this item that it is no longer in use, the result of getComponent() can be null or change after this method has been called.


setOrientation

void setOrientation(Orientation orientation)
Tells this item the orientation of the toolbar

Parameters:
orientation - the orientation of the toolbar

setSelected

void setSelected(boolean selected)
Informs this item whether it is actually shown or not.

Parameters:
selected - true if the item is shown

setController

void setController(bibliothek.gui.DockController controller)
Informs this item about the DockController in whose realm it is used. This method will always be called before bind(), or after unbind(), is executed.

Parameters:
controller - the controller in whose realm this item works, can be null

setDockable

void setDockable(ToolbarItemDockable dockable)
Informs this item about the Dockable that is using it.

Parameters:
dockable - the owner of this item

addMouseInputListener

void addMouseInputListener(MouseInputListener listener)
Urges this item to add listener to its component. This method must only be called if bind() was executed.

Parameters:
listener - the MouseListener and MouseMotionListener that should be added

removeMouseInputListener

void removeMouseInputListener(MouseInputListener listener)
Urges this item to remove listener from its component. This method must only be called if bind() was executed.

Parameters:
listener - the MouseListener and MouseMotionListener that should be removed