bibliothek.gui.dock
Class ToolbarItemDockable

java.lang.Object
  extended by bibliothek.gui.dock.dockable.AbstractDockable
      extended by bibliothek.gui.dock.ToolbarItemDockable
All Implemented Interfaces:
bibliothek.gui.dock.component.DockComponentRoot, bibliothek.gui.dock.DockElement, bibliothek.gui.dock.DockElementRepresentative, bibliothek.gui.dock.station.support.PlaceholderListItem<bibliothek.gui.Dockable>, ExpandableToolbarItem, bibliothek.gui.Dockable
Direct Known Subclasses:
CommonToolbarItemDockable

public class ToolbarItemDockable
extends bibliothek.gui.dock.dockable.AbstractDockable
implements ExpandableToolbarItem

A ToolbarItemDockable is a Dockable that can be shown as child of a ToolbarDockStation. This class acts as wrapper around a ToolbarItem which can just be any kind of Component.
This class supports ExpandableToolbarItem, clients can call setItem(ToolbarItem, ExpandedState) to fill up the different positions.

Author:
Benjamin Sigg

Constructor Summary
ToolbarItemDockable()
          Creates a new dockable
ToolbarItemDockable(Component component)
          Creates a new dockable
ToolbarItemDockable(Component component, Icon icon)
          Creates a new dockable
ToolbarItemDockable(Component component, String title)
          Creates a new dockable
ToolbarItemDockable(Component component, String title, Icon icon)
          Creates a new dockable
ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action)
          Creates a new dockable
ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action, Icon icon)
          Creates a new dockable
ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action, String title)
          Creates a new dockable
ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action, String title, Icon icon)
          Creates a new dockable
ToolbarItemDockable(Icon icon)
          Creates a new dockable
ToolbarItemDockable(String title)
          Creates a new dockable
ToolbarItemDockable(ToolbarItem item)
          Creates a new dockable
ToolbarItemDockable(ToolbarItem item, Icon icon)
          Creates a new dockable
ToolbarItemDockable(ToolbarItem item, String title)
          Creates a new dockable
ToolbarItemDockable(ToolbarItem item, String title, Icon icon)
          Creates a new dockable
 
Method Summary
 boolean accept(bibliothek.gui.DockStation station)
           
 boolean accept(bibliothek.gui.DockStation base, bibliothek.gui.Dockable neighbour)
           
 void addExpandableListener(ExpandableToolbarItemListener listener)
          Adds the observer listener to this item.
 void addMouseInputListener(MouseInputListener listener)
           
 bibliothek.gui.DockStation asDockStation()
           
protected  bibliothek.gui.dock.component.DockComponentRootHandler createRootHandler()
           
protected  bibliothek.gui.dock.util.icon.DockIcon createTitleIcon()
           
 Component getComponent()
           
 ExpandedState getExpandedState()
          Gets the current state of this item.
 String getFactoryID()
           
 Orientation getOrientation()
          Gets the latest known orientation of this dockable
 boolean isEnabled(ExpandedState state)
          Tells whether this ExpandableToolbarItem likes to be in state state.
 void removeExpandableListener(ExpandableToolbarItemListener listener)
          Removes the observer listener from this item.
 void removeMouseInputListener(MouseInputListener listener)
           
 void setAction(bibliothek.gui.dock.action.DockAction action, ExpandedState state)
          Sets the DockAction which should be shown if in state state.
 void setComponent(Component component, ExpandedState state)
          Sets the Component which should be shown if in state state.
 void setController(bibliothek.gui.DockController controller)
           
 void setExpandedState(ExpandedState state)
          Changes the state of this item to state.
 void setItem(ToolbarItem item, ExpandedState state)
          Sets the ToolbarItem which should be shown if in state state.
 String toString()
           
 
Methods inherited from class bibliothek.gui.dock.dockable.AbstractDockable
addDockableListener, addDockableStateListener, addDockHierarchyListener, addKeyListener, asDockable, bind, configureDisplayerHints, fireTitleBound, fireTitleExchanged, fireTitleExchanged, fireTitleIconChanged, fireTitleTextChanged, fireTitleTooltipChanged, fireTitleUnbound, getComponentConfiguration, getConfigurableDisplayerHints, getController, getDockableStateListeners, getDockElementObserver, getDockParent, getElement, getGlobalActionOffers, getLocalActionOffers, getPopupLocation, getRootHandler, getTitleIcon, getTitleIconHandling, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, isUsedAsTitle, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, removeKeyListener, requestDisplayer, requestDockTitle, resetTitleIcon, setActionOffers, setComponentConfiguration, setDockParent, setTitleIcon, setTitleIconHandling, setTitleText, setTitleToolTip, shouldFocus, shouldTransfersFocus, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.Dockable
addDockableListener, addDockableStateListener, addDockHierarchyListener, bind, configureDisplayerHints, getController, getDockParent, getGlobalActionOffers, getLocalActionOffers, getTitleIcon, getTitleText, getTitleToolTip, isDockableShowing, isDockableVisible, listBoundTitles, removeDockableListener, removeDockableStateListener, removeDockHierarchyListener, requestDisplayer, requestDockTitle, setDockParent, unbind
 
Methods inherited from interface bibliothek.gui.dock.DockElement
asDockable
 
Methods inherited from interface bibliothek.gui.dock.component.DockComponentRoot
getComponentConfiguration, setComponentConfiguration
 
Methods inherited from interface bibliothek.gui.dock.DockElementRepresentative
getElement, getPopupLocation, isUsedAsTitle, shouldFocus, shouldTransfersFocus
 
Methods inherited from interface bibliothek.gui.dock.station.support.PlaceholderListItem
asDockable
 

Constructor Detail

ToolbarItemDockable

public ToolbarItemDockable()
Creates a new dockable


ToolbarItemDockable

public ToolbarItemDockable(Icon icon)
Creates a new dockable

Parameters:
icon - the icon of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(String title)
Creates a new dockable

Parameters:
title - the title of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action)
Creates a new dockable

Parameters:
action - the item to show in the ExpandedState.SHRUNK, can be null

ToolbarItemDockable

public ToolbarItemDockable(Component component)
Creates a new dockable

Parameters:
component - the item to show in the ExpandedState.SHRUNK, can be null

ToolbarItemDockable

public ToolbarItemDockable(ToolbarItem item)
Creates a new dockable

Parameters:
item - the item to show in the ExpandedState.SHRUNK, can be null

ToolbarItemDockable

public ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action,
                           Icon icon)
Creates a new dockable

Parameters:
action - the item to show in the ExpandedState.SHRUNK, can be null
icon - the icon of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(Component component,
                           Icon icon)
Creates a new dockable

Parameters:
component - the item to show in the ExpandedState.SHRUNK, can be null
icon - the icon of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(ToolbarItem item,
                           Icon icon)
Creates a new dockable

Parameters:
item - the item to show in the ExpandedState.SHRUNK, can be null
icon - the icon of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action,
                           String title)
Creates a new dockable

Parameters:
action - the item to show in the ExpandedState.SHRUNK, can be null
title - the title of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(Component component,
                           String title)
Creates a new dockable

Parameters:
component - the item to show in the ExpandedState.SHRUNK, can be null
title - the title of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(ToolbarItem item,
                           String title)
Creates a new dockable

Parameters:
item - the item to show in the ExpandedState.SHRUNK, can be null
title - the title of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(bibliothek.gui.dock.action.DockAction action,
                           String title,
                           Icon icon)
Creates a new dockable

Parameters:
action - the item to show in the ExpandedState.SHRUNK, can be null
title - the title of this dockable, can be null
icon - the icon of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(Component component,
                           String title,
                           Icon icon)
Creates a new dockable

Parameters:
component - the item to show in the ExpandedState.SHRUNK, can be null
title - the title of this dockable, can be null
icon - the icon of this dockable, can be null

ToolbarItemDockable

public ToolbarItemDockable(ToolbarItem item,
                           String title,
                           Icon icon)
Creates a new dockable

Parameters:
item - the item to show in the ExpandedState.SHRUNK, can be null
title - the title of this dockable, can be null
icon - the icon of this dockable, can be null
Method Detail

createRootHandler

protected bibliothek.gui.dock.component.DockComponentRootHandler createRootHandler()
Specified by:
createRootHandler in class bibliothek.gui.dock.dockable.AbstractDockable

addMouseInputListener

public void addMouseInputListener(MouseInputListener listener)
Specified by:
addMouseInputListener in interface bibliothek.gui.dock.DockElementRepresentative
Specified by:
addMouseInputListener in interface bibliothek.gui.Dockable
Overrides:
addMouseInputListener in class bibliothek.gui.dock.dockable.AbstractDockable

removeMouseInputListener

public void removeMouseInputListener(MouseInputListener listener)
Specified by:
removeMouseInputListener in interface bibliothek.gui.dock.DockElementRepresentative
Specified by:
removeMouseInputListener in interface bibliothek.gui.Dockable
Overrides:
removeMouseInputListener in class bibliothek.gui.dock.dockable.AbstractDockable

setAction

public void setAction(bibliothek.gui.dock.action.DockAction action,
                      ExpandedState state)
Sets the DockAction which should be shown if in state state. Please note that the same DockAction cannot be used for more than one state.

Parameters:
action - the item to set
state - the state in which to show action

setComponent

public void setComponent(Component component,
                         ExpandedState state)
Sets the Component which should be shown if in state state. Please note that the same Component cannot be used for more than one state.

Parameters:
component - the item to set
state - the state in which to show component

setItem

public void setItem(ToolbarItem item,
                    ExpandedState state)
Sets the ToolbarItem which should be shown if in state state. Please note that the same ToolbarItem cannot be used for more than one state.

Parameters:
item - the item to set
state - the state in which to show item

setController

public void setController(bibliothek.gui.DockController controller)
Specified by:
setController in interface bibliothek.gui.Dockable
Overrides:
setController in class bibliothek.gui.dock.dockable.AbstractDockable

setExpandedState

public void setExpandedState(ExpandedState state)
Description copied from interface: ExpandableToolbarItem
Changes the state of this item to state. Note that state can be any state, including those for which ExpandableToolbarItem.isEnabled(ExpandedState) returned false.

Specified by:
setExpandedState in interface ExpandableToolbarItem
Parameters:
state - the new state

isEnabled

public boolean isEnabled(ExpandedState state)
Description copied from interface: ExpandableToolbarItem
Tells whether this ExpandableToolbarItem likes to be in state state.

Specified by:
isEnabled in interface ExpandableToolbarItem
Parameters:
state - a possible state
Returns:
whether this item likes to be in state

getExpandedState

public ExpandedState getExpandedState()
Description copied from interface: ExpandableToolbarItem
Gets the current state of this item.

Specified by:
getExpandedState in interface ExpandableToolbarItem
Returns:
the current state

getOrientation

public Orientation getOrientation()
Gets the latest known orientation of this dockable

Returns:
the orientation, or null if unknown

getComponent

public Component getComponent()
Specified by:
getComponent in interface bibliothek.gui.dock.DockElementRepresentative
Specified by:
getComponent in interface bibliothek.gui.Dockable

addExpandableListener

public void addExpandableListener(ExpandableToolbarItemListener listener)
Description copied from interface: ExpandableToolbarItem
Adds the observer listener to this item.

Specified by:
addExpandableListener in interface ExpandableToolbarItem
Parameters:
listener - the new listener, not null

removeExpandableListener

public void removeExpandableListener(ExpandableToolbarItemListener listener)
Description copied from interface: ExpandableToolbarItem
Removes the observer listener from this item.

Specified by:
removeExpandableListener in interface ExpandableToolbarItem
Parameters:
listener - the listener to remove

asDockStation

public bibliothek.gui.DockStation asDockStation()
Specified by:
asDockStation in interface bibliothek.gui.dock.DockElement

getFactoryID

public String getFactoryID()
Specified by:
getFactoryID in interface bibliothek.gui.dock.DockElement

createTitleIcon

protected bibliothek.gui.dock.util.icon.DockIcon createTitleIcon()
Specified by:
createTitleIcon in class bibliothek.gui.dock.dockable.AbstractDockable

accept

public boolean accept(bibliothek.gui.DockStation station)
Specified by:
accept in interface bibliothek.gui.Dockable
Overrides:
accept in class bibliothek.gui.dock.dockable.AbstractDockable

accept

public boolean accept(bibliothek.gui.DockStation base,
                      bibliothek.gui.Dockable neighbour)
Specified by:
accept in interface bibliothek.gui.Dockable
Overrides:
accept in class bibliothek.gui.dock.dockable.AbstractDockable

toString

public String toString()
Overrides:
toString in class Object