bibliothek.gui.dock.toolbar.expand
Class DefaultExpandableToolbarItemStrategy

java.lang.Object
  extended by bibliothek.gui.dock.toolbar.expand.DefaultExpandableToolbarItemStrategy
All Implemented Interfaces:
ExpandableToolbarItemStrategy

public class DefaultExpandableToolbarItemStrategy
extends Object
implements ExpandableToolbarItemStrategy

The default implementation of an ExpandableToolbarItemStrategy searches for ExpandableToolbarItems.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.ExpandableToolbarItemStrategy
STRATEGY
 
Constructor Summary
DefaultExpandableToolbarItemStrategy()
           
 
Method Summary
 void addExpandedListener(ExpandableToolbarItemStrategyListener listener)
          Adds a listener to this strategy, the listener is to be informed if the state of an item changes.
 ExpandedState getState(bibliothek.gui.Dockable item)
          Gets the current state item has.
protected  void handleAdd(bibliothek.gui.Dockable dockable)
           
protected  void handleAdd(bibliothek.gui.DockStation station)
           
protected  void handleRemove(bibliothek.gui.Dockable dockable)
           
protected  void handleRemove(bibliothek.gui.DockStation station)
           
 void install(bibliothek.gui.DockController controller)
          Called if this strategy is used by controller.
 boolean isEnabled(bibliothek.gui.Dockable item, ExpandedState state)
          Tells whether the Dockable item can have the state state.
protected  ExpandableToolbarItemStrategyListener[] listeners()
          Gets all the ExpandableToolbarItemStrategyListeners that are currently registered.
 void removeExpandedListener(ExpandableToolbarItemStrategyListener listener)
          Removes a listener from this strategy.
 void setState(bibliothek.gui.Dockable item, ExpandedState state)
          Changes the state of item to state.
 void uninstall(bibliothek.gui.DockController controller)
          Called if this strategy is no longer used by controller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultExpandableToolbarItemStrategy

public DefaultExpandableToolbarItemStrategy()
Method Detail

handleAdd

protected void handleAdd(bibliothek.gui.Dockable dockable)

handleAdd

protected void handleAdd(bibliothek.gui.DockStation station)

handleRemove

protected void handleRemove(bibliothek.gui.Dockable dockable)

handleRemove

protected void handleRemove(bibliothek.gui.DockStation station)

install

public void install(bibliothek.gui.DockController controller)
Description copied from interface: ExpandableToolbarItemStrategy
Called if this strategy is used by controller.

Specified by:
install in interface ExpandableToolbarItemStrategy
Parameters:
controller - the controller using this strategy

uninstall

public void uninstall(bibliothek.gui.DockController controller)
Description copied from interface: ExpandableToolbarItemStrategy
Called if this strategy is no longer used by controller.

Specified by:
uninstall in interface ExpandableToolbarItemStrategy
Parameters:
controller - the controller which is no longer using this strategy

isEnabled

public boolean isEnabled(bibliothek.gui.Dockable item,
                         ExpandedState state)
Description copied from interface: ExpandableToolbarItemStrategy
Tells whether the Dockable item can have the state state.

Specified by:
isEnabled in interface ExpandableToolbarItemStrategy
Parameters:
item - the item to check
state - the state that might be applied to item
Returns:
true if this strategy knows how to change the state of item to state

getState

public ExpandedState getState(bibliothek.gui.Dockable item)
Description copied from interface: ExpandableToolbarItemStrategy
Gets the current state item has.

Specified by:
getState in interface ExpandableToolbarItemStrategy
Parameters:
item - some Dockable
Returns:
the state or null if item is not supported by this strategy.

setState

public void setState(bibliothek.gui.Dockable item,
                     ExpandedState state)
Description copied from interface: ExpandableToolbarItemStrategy
Changes the state of item to state. The strategy may refuse to do anything or replace state if state is not enabled for item.

Specified by:
setState in interface ExpandableToolbarItemStrategy
Parameters:
item - the item whose state is changed
state - the new state, this is a state which is enabled

addExpandedListener

public void addExpandedListener(ExpandableToolbarItemStrategyListener listener)
Description copied from interface: ExpandableToolbarItemStrategy
Adds a listener to this strategy, the listener is to be informed if the state of an item changes.

Specified by:
addExpandedListener in interface ExpandableToolbarItemStrategy
Parameters:
listener - the new listener, not null

removeExpandedListener

public void removeExpandedListener(ExpandableToolbarItemStrategyListener listener)
Description copied from interface: ExpandableToolbarItemStrategy
Removes a listener from this strategy.

Specified by:
removeExpandedListener in interface ExpandableToolbarItemStrategy
Parameters:
listener - the listener to remove

listeners

protected ExpandableToolbarItemStrategyListener[] listeners()
Gets all the ExpandableToolbarItemStrategyListeners that are currently registered.

Returns:
all the listeners