bibliothek.gui.dock.toolbar
Class CToolbarItem

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.AbstractCDockable
      extended by bibliothek.gui.dock.toolbar.CToolbarItem
All Implemented Interfaces:
bibliothek.gui.dock.common.intern.CDockable, bibliothek.gui.dock.common.SingleCDockable

public class CToolbarItem
extends bibliothek.gui.dock.common.intern.AbstractCDockable
implements bibliothek.gui.dock.common.SingleCDockable

A CToolbarItem is an item (e.g. a button) that is shown in a toolbar.
In reality the CToolbarItem consists of several Components, but only one of them is shown. Which one depends on the ExpandedState which is set by the toolbar itself. In order to use this feature clients have to call CControl control = ... control.putProperty( ExpandableToolbarItemStrategy.STRATEGY, new DefaultExpandableToolbarItemStrategy() );

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
listenerCollection
 
Fields inherited from interface bibliothek.gui.dock.common.intern.CDockable
ACTION_KEY_CLOSE, ACTION_KEY_EXTERNALIZE, ACTION_KEY_MAXIMIZE, ACTION_KEY_MINIMIZE, ACTION_KEY_MINIMIZE_HOLD, ACTION_KEY_NORMALIZE, ACTION_KEY_UNEXTERNALIZE, ACTION_KEY_UNMAXIMIZE_EXTERNALIZED
 
Constructor Summary
CToolbarItem(String id)
          Creates a new item.
 
Method Summary
 bibliothek.gui.dock.common.CStation<?> asStation()
           
protected  CommonToolbarItemDockable createCommonDockable()
           
 String getUniqueId()
           
 CommonToolbarItemDockable intern()
           
 boolean isCloseable()
           
 boolean isExternalizable()
           
 boolean isMaximizable()
           
 boolean isMinimizable()
           
 boolean isStackable()
           
 void setItem(bibliothek.gui.dock.common.action.CAction item)
          Sets a component which should be shown when this dockable is in state ExpandedState.SHRUNK.
 void setItem(bibliothek.gui.dock.common.action.CAction item, ExpandedState state)
          Sets a component which should be shown when this dockable is in state state.
 void setItem(Component item)
          Sets a component which should be shown when this dockable is in state ExpandedState.SHRUNK.
 void setItem(Component item, ExpandedState state)
          Sets a component which should be shown when this dockable is in state state.
 void setItem(ToolbarItem item, ExpandedState state)
          Sets a component which should be shown when this dockable is in state state.
 
Methods inherited from class bibliothek.gui.dock.common.intern.AbstractCDockable
addCDockableLocationListener, addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, control, getAction, getAndClearResizeRequest, getAutoBaseLocation, getBaseLocation, getClose, getColors, getControl, getControlAccess, getDefaultLocation, getDockableUniqueId, getExtendedMode, getFocusComponent, getFonts, getMinimizedSize, getParentStation, getWorkingArea, hasParent, init, isDockableVisible, isEnabled, isNormalizeable, isResizeLocked, isResizeLockedHorizontally, isResizeLockedVertically, isShowing, isSingleTabShown, isSticky, isStickySwitchable, isTitleShown, isVisible, propertyListeners, putAction, removeCDockableLocationListener, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setControlAccess, setDefaultLocation, setEnabled, setExtendedMode, setFocusComponent, setLocation, setLocationsAside, setLocationsAside, setLocationsAsideFocused, setMinimizedSize, setResizeLocked, setResizeLockedHorizontally, setResizeLockedVertically, setResizeRequest, setResizeRequest, setSingleTabShown, setSticky, setStickySwitchable, setTitleShown, setVisible, setWorkingArea, stateListeners, toFront, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.common.intern.CDockable
addCDockableLocationListener, addCDockablePropertyListener, addCDockableStateListener, addDoubleClickListener, addFocusListener, addKeyboardListener, addVetoClosingListener, getAction, getAndClearResizeRequest, getAutoBaseLocation, getBaseLocation, getColors, getControl, getControlAccess, getExtendedMode, getFocusComponent, getFonts, getMinimizedSize, getParentStation, getWorkingArea, hasParent, isDockableVisible, isEnabled, isNormalizeable, isResizeLockedHorizontally, isResizeLockedVertically, isShowing, isSingleTabShown, isSticky, isStickySwitchable, isTitleShown, isVisible, removeCDockableLocationListener, removeCDockablePropertyListener, removeCDockableStateListener, removeDoubleClickListener, removeFocusListener, removeKeyboardListener, removeVetoClosingListener, setControlAccess, setExtendedMode, setLocation, setLocationsAside, setLocationsAside, setLocationsAsideFocused, setMinimizedSize, setSticky, setStickySwitchable, setVisible, setWorkingArea
 

Constructor Detail

CToolbarItem

public CToolbarItem(String id)
Creates a new item.

Parameters:
id - the unique identifier of this item, not null
Method Detail

setItem

public void setItem(bibliothek.gui.dock.common.action.CAction item)
Sets a component which should be shown when this dockable is in state ExpandedState.SHRUNK.

Parameters:
item - the item to show, can be null

setItem

public void setItem(Component item)
Sets a component which should be shown when this dockable is in state ExpandedState.SHRUNK.

Parameters:
item - the item to show, can be null

setItem

public void setItem(Component item,
                    ExpandedState state)
Sets a component which should be shown when this dockable is in state state.

Parameters:
item - the item to show, can be null
state - the state when to show item

setItem

public void setItem(bibliothek.gui.dock.common.action.CAction item,
                    ExpandedState state)
Sets a component which should be shown when this dockable is in state state.

Parameters:
item - the item to show, can be null
state - the state when to show item

setItem

public void setItem(ToolbarItem item,
                    ExpandedState state)
Sets a component which should be shown when this dockable is in state state.

Parameters:
item - the item to show, can be null
state - the state when to show item

getUniqueId

public String getUniqueId()
Specified by:
getUniqueId in interface bibliothek.gui.dock.common.SingleCDockable

isMinimizable

public boolean isMinimizable()
Specified by:
isMinimizable in interface bibliothek.gui.dock.common.intern.CDockable

isMaximizable

public boolean isMaximizable()
Specified by:
isMaximizable in interface bibliothek.gui.dock.common.intern.CDockable

isExternalizable

public boolean isExternalizable()
Specified by:
isExternalizable in interface bibliothek.gui.dock.common.intern.CDockable

isStackable

public boolean isStackable()
Specified by:
isStackable in interface bibliothek.gui.dock.common.intern.CDockable

isCloseable

public boolean isCloseable()
Specified by:
isCloseable in interface bibliothek.gui.dock.common.intern.CDockable

asStation

public bibliothek.gui.dock.common.CStation<?> asStation()
Specified by:
asStation in interface bibliothek.gui.dock.common.intern.CDockable

intern

public CommonToolbarItemDockable intern()
Specified by:
intern in interface bibliothek.gui.dock.common.intern.CDockable
Overrides:
intern in class bibliothek.gui.dock.common.intern.AbstractCDockable

createCommonDockable

protected CommonToolbarItemDockable createCommonDockable()
Specified by:
createCommonDockable in class bibliothek.gui.dock.common.intern.AbstractCDockable