public class CDisablingStrategy extends java.lang.Object implements DisablingStrategy
CDockablePropertyListener
to each CDockable
and reads the value of
CDockable.isEnabled(bibliothek.gui.dock.common.EnableableItem)
to find out which Dockable
s
are disabled.STRATEGY
Constructor and Description |
---|
CDisablingStrategy(CControl control)
Creates a new strategy, this constructor will add a listener to
control . |
Modifier and Type | Method and Description |
---|---|
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. |
public CDisablingStrategy(CControl control)
control
.control
- the control in whose realm this strategy will operatepublic void addDisablingStrategyListener(DisablingStrategyListener listener)
DisablingStrategy
listener
to this object, the listener will be informed when the state of this
DisablingStrategy
changes.addDisablingStrategyListener
in interface DisablingStrategy
listener
- the listener to add, not null
public void removeDisablingStrategyListener(DisablingStrategyListener listener)
DisablingStrategy
listener
from this object.removeDisablingStrategyListener
in interface DisablingStrategy
listener
- the listener to removepublic boolean isDisabled(DockElement item)
DisablingStrategy
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.isDisabled
in interface DisablingStrategy
item
- the item which may be disableditem
is disabledpublic boolean isDisabled(Dockable dockable, DockAction item)
DisablingStrategy
item
, which is shown together with dockable
, is disabled.isDisabled
in interface DisablingStrategy
dockable
- the dockable which shows item
item
- the action that might be disableditem
is disabledpublic boolean isDisabled(Dockable dockable, DockTitle item)
DisablingStrategy
item
, which is shown together with dockable
, is disabled.isDisabled
in interface DisablingStrategy
dockable
- the dockable which shows item
item
- the title that might be disableditem
is disabledpublic boolean isTabDisabled(Dockable dockable)
DisablingStrategy
dockable
is shown with some tabs (e.g. some EclipseTab
s), this method decides
whether the tabs are disabled.isTabDisabled
in interface DisablingStrategy
dockable
- the dockable which is shown together with some tab