bibliothek.gui.dock.facile.action
Class ReplaceActionGuard

java.lang.Object
  extended by bibliothek.gui.dock.facile.action.ReplaceActionGuard
All Implemented Interfaces:
ActionGuard

@ClientOnly
public class ReplaceActionGuard
extends java.lang.Object
implements ActionGuard

An ActionGuard that adds a ReplaceAction to all elements that are Dockable and DockStation at the same time.

Author:
Benjamin Sigg

Constructor Summary
ReplaceActionGuard(DockController controller)
          Creates a new guard
 
Method Summary
 DockActionSource getSource(Dockable dockable)
          Gets a list of actions for the Dockable
 boolean isVisible()
          Tells whether the action of this guard can be seen or not
 boolean react(Dockable dockable)
          Tests the given Dockable and tells whether this ActionGuard is interested in it and wants to add some additional actions to it, or if this guard is not made for the dockable.
 void setVisible(boolean visible)
          Sets the visibility of the action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReplaceActionGuard

public ReplaceActionGuard(DockController controller)
Creates a new guard

Parameters:
controller - The controller for which actions are created.
Method Detail

setVisible

public void setVisible(boolean visible)
Sets the visibility of the action. The visibility can be changed at any time and has effect on all occurrences of the action.

Parameters:
visible - the new state

isVisible

public boolean isVisible()
Tells whether the action of this guard can be seen or not

Returns:
true if the action can be seen

getSource

public DockActionSource getSource(Dockable dockable)
Description copied from interface: ActionGuard
Gets a list of actions for the Dockable

Specified by:
getSource in interface ActionGuard
Parameters:
dockable - The Dockable for which ActionGuard.react(Dockable) is true
Returns:
The actions which shall be used together with the dockable.

react

public boolean react(Dockable dockable)
Description copied from interface: ActionGuard
Tests the given Dockable and tells whether this ActionGuard is interested in it and wants to add some additional actions to it, or if this guard is not made for the dockable.

Specified by:
react in interface ActionGuard
Parameters:
dockable - The Dockable to test
Returns:
true if the ActionGuard.getSource(Dockable)-method should be invoked, false otherwise