bibliothek.gui.dock.disable
Interface DisablingStrategy

All Known Implementing Classes:
CDisablingStrategy

public interface DisablingStrategy

An DisablingStrategy can be used to globaly disable DockElements and parts of DockElements like their DockActions or their DockTitles.
Implementation wise an DisablingStrategy only offers a hint, each item has to decide on its own whether it should heed the hint. All the default items of the framework do however heed the hint.
This interface was added due to popular request. Developers should be aware that many use cases involving disabling items are rather dubios. Used in the wrong way, the DisablingStrategy can break a lot functionality of the framework. E.g. it can prevent the user from closing a Dockable he just does not need right now.

Author:
Benjamin Sigg

Field Summary
static PropertyKey<DisablingStrategy> STRATEGY
          The unique identifier for the DockProperties, need to get or set the current DisablingStrategy.
 
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.
 

Field Detail

STRATEGY

static final PropertyKey<DisablingStrategy> STRATEGY
The unique identifier for the DockProperties, need to get or set the current DisablingStrategy.

Method Detail

addDisablingStrategyListener

void addDisablingStrategyListener(DisablingStrategyListener listener)
Adds listener to this object, the listener will be informed when the state of this DisablingStrategy changes.

Parameters:
listener - the listener to add, not null

removeDisablingStrategyListener

void removeDisablingStrategyListener(DisablingStrategyListener listener)
Removes listener from this object.

Parameters:
listener - the listener to remove

isDisabled

boolean isDisabled(DockElement item)
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.

Parameters:
item - the item which may be disabled
Returns:
whether item is disabled

isDisabled

boolean isDisabled(Dockable dockable,
                   DockAction item)
Tells whether the action item, which is shown together with dockable, is disabled.

Parameters:
dockable - the dockable which shows item
item - the action that might be disabled
Returns:
whether item is disabled

isDisabled

boolean isDisabled(Dockable dockable,
                   DockTitle item)
Tells whether the title item, which is shown together with dockable, is disabled.

Parameters:
dockable - the dockable which shows item
item - the title that might be disabled
Returns:
whether item is disabled

isTabDisabled

boolean isTabDisabled(Dockable dockable)
Assuming dockable is shown with some tabs (e.g. some EclipseTabs), this method decides whether the tabs are disabled.

Parameters:
dockable - the dockable which is shown together with some tab
Returns:
whether the tab is disabled