bibliothek.gui.dock
Interface ExpandableToolbarItemStrategy

All Known Implementing Classes:
DefaultExpandableToolbarItemStrategy, DisabledExpandableToolbarItemStrategy

public interface ExpandableToolbarItemStrategy

An ExpandableToolbarItemStrategy is a strategy that allows to expand and to shrink items of a toolbar.

Author:
Benjamin Sigg

Field Summary
static bibliothek.gui.dock.util.PropertyKey<ExpandableToolbarItemStrategy> STRATEGY
          An identifier to exchange the strategy.
 
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.
 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.
 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.
 

Field Detail

STRATEGY

static final bibliothek.gui.dock.util.PropertyKey<ExpandableToolbarItemStrategy> STRATEGY
An identifier to exchange the strategy.

See Also:
DefaultExpandableToolbarItemStrategy
Method Detail

install

void install(bibliothek.gui.DockController controller)
Called if this strategy is used by controller.

Parameters:
controller - the controller using this strategy

uninstall

void uninstall(bibliothek.gui.DockController controller)
Called if this strategy is no longer used by controller.

Parameters:
controller - the controller which is no longer using this strategy

isEnabled

boolean isEnabled(bibliothek.gui.Dockable item,
                  ExpandedState state)
Tells whether the Dockable item can have the state state.

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

ExpandedState getState(bibliothek.gui.Dockable item)
Gets the current state item has.

Parameters:
item - some Dockable
Returns:
the state or null if item is not supported by this strategy.

setState

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

Parameters:
item - the item whose state is changed
state - the new state, this is a state which is enabled

addExpandedListener

void addExpandedListener(ExpandableToolbarItemStrategyListener listener)
Adds a listener to this strategy, the listener is to be informed if the state of an item changes.

Parameters:
listener - the new listener, not null

removeExpandedListener

void removeExpandedListener(ExpandableToolbarItemStrategyListener listener)
Removes a listener from this strategy.

Parameters:
listener - the listener to remove