bibliothek.gui.dock.common.intern.ui
Class CDisablingStrategy

java.lang.Object
  extended by bibliothek.gui.dock.common.intern.ui.CDisablingStrategy
All Implemented Interfaces:
DisablingStrategy

public class CDisablingStrategy
extends Object
implements DisablingStrategy

Adds a CDockablePropertyListener to each CDockable and reads the value of CDockable.isEnabled(bibliothek.gui.dock.common.EnableableItem) to find out which Dockables are disabled.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.disable.DisablingStrategy
STRATEGY
 
Constructor Summary
CDisablingStrategy(CControl control)
          Creates a new strategy, this constructor will add a listener to control.
 
Method Summary
 void addDisablingStrategyListener(DisablingStrategyListener listener)
          Adds listener to this object, the listener will be informed when the state of this DisablingStrategy changes.
 boolean isDisabled(Dockable dockable, DockAction item)
          Tells whether the action item, which is shown together with dockable, is disabled.
 boolean isDisabled(Dockable dockable, DockTitle item)
          Tells whether the title item, which is shown together with dockable, is disabled.
 boolean isDisabled(DockElement item)
          Tells whether the item DockElement is disabled in general.
 boolean isTabDisabled(Dockable dockable)
          Assuming dockable is shown with some tabs (e.g.
 void removeDisablingStrategyListener(DisablingStrategyListener listener)
          Removes listener from this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CDisablingStrategy

public CDisablingStrategy(CControl control)
Creates a new strategy, this constructor will add a listener to control.

Parameters:
control - the control in whose realm this strategy will operate
Method Detail

addDisablingStrategyListener

public void addDisablingStrategyListener(DisablingStrategyListener listener)
Description copied from interface: DisablingStrategy
Adds listener to this object, the listener will be informed when the state of this DisablingStrategy changes.

Specified by:
addDisablingStrategyListener in interface DisablingStrategy
Parameters:
listener - the listener to add, not null

removeDisablingStrategyListener

public void removeDisablingStrategyListener(DisablingStrategyListener listener)
Description copied from interface: DisablingStrategy
Removes listener from this object.

Specified by:
removeDisablingStrategyListener in interface DisablingStrategy
Parameters:
listener - the listener to remove

isDisabled

public boolean isDisabled(DockElement item)
Description copied from interface: DisablingStrategy
Tells whether the item DockElement is disabled in general. The exact effects of being disabled are not defined, but when using the default implementation developers can expect that item will not participate in any kind of drag and drop operation.

Specified by:
isDisabled in interface DisablingStrategy
Parameters:
item - the item which may be disabled
Returns:
whether item is disabled

isDisabled

public boolean isDisabled(Dockable dockable,
                          DockAction item)
Description copied from interface: DisablingStrategy
Tells whether the action item, which is shown together with dockable, is disabled.

Specified by:
isDisabled in interface DisablingStrategy
Parameters:
dockable - the dockable which shows item
item - the action that might be disabled
Returns:
whether item is disabled

isDisabled

public boolean isDisabled(Dockable dockable,
                          DockTitle item)
Description copied from interface: DisablingStrategy
Tells whether the title item, which is shown together with dockable, is disabled.

Specified by:
isDisabled in interface DisablingStrategy
Parameters:
dockable - the dockable which shows item
item - the title that might be disabled
Returns:
whether item is disabled

isTabDisabled

public boolean isTabDisabled(Dockable dockable)
Description copied from interface: DisablingStrategy
Assuming dockable is shown with some tabs (e.g. some EclipseTabs), this method decides whether the tabs are disabled.

Specified by:
isTabDisabled in interface DisablingStrategy
Parameters:
dockable - the dockable which is shown together with some tab
Returns:
whether the tab is disabled