bibliothek.gui.dock.action.actions
Class SeparatorAction

java.lang.Object
  extended by bibliothek.gui.dock.action.actions.SeparatorAction
All Implemented Interfaces:
DockAction
Direct Known Subclasses:
CommonSeparatorAction

public class SeparatorAction
extends Object
implements DockAction

A separator represents a space between actions. A separator has no state, he is purely graphical.

Author:
Benjamin Sigg

Field Summary
static SeparatorAction MENU_SEPARATOR
          A separator that is only visible on menus
static SeparatorAction SEPARATOR
          A separator that is visible on menus and on titles
static SeparatorAction TITLE_SEPARATOR
          A separator which is only visible on titles
 
Fields inherited from interface bibliothek.gui.dock.action.DockAction
BUTTON_CONTENT_FILTER
 
Constructor Summary
SeparatorAction(ViewTarget<?>... targets)
          Creates a new separator.
 
Method Summary
 void bind(Dockable dockable)
          Informs this DockAction that icons, text, and other stuff like that, will be requested from this DockAction.
<V> V
createView(ViewTarget<V> target, ActionViewConverter converter, Dockable dockable)
          Creates a view for this action, for the platform target and with help of converter.
 boolean shouldDisplay(ViewTarget<?> target)
          Tells whether the separator should be shown or not.
 boolean trigger(Dockable dockable)
          Does the appropriate action that can be done respecting the current state of this action.
 void unbind(Dockable dockable)
          Invoked only if the dockable was bound to this DockAction, and if the dockable will no longer be used for any method calls (except bind) on this DockAction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEPARATOR

public static final SeparatorAction SEPARATOR
A separator that is visible on menus and on titles


MENU_SEPARATOR

public static final SeparatorAction MENU_SEPARATOR
A separator that is only visible on menus


TITLE_SEPARATOR

public static final SeparatorAction TITLE_SEPARATOR
A separator which is only visible on titles

Constructor Detail

SeparatorAction

public SeparatorAction(ViewTarget<?>... targets)
Creates a new separator.

Parameters:
targets - the targets on which this separator should be visible
Method Detail

shouldDisplay

public boolean shouldDisplay(ViewTarget<?> target)
Tells whether the separator should be shown or not.

Parameters:
target - the target on which the separator might be made visible
Returns:
true if the separator should be shown, false otherwise.

bind

public void bind(Dockable dockable)
Description copied from interface: DockAction
Informs this DockAction that icons, text, and other stuff like that, will be requested from this DockAction. This method should be called from the object that will display the view of this action.

Specified by:
bind in interface DockAction
Parameters:
dockable - the Dockable that may be used in the future
See Also:
DockAction.unbind(Dockable)

unbind

public void unbind(Dockable dockable)
Description copied from interface: DockAction
Invoked only if the dockable was bound to this DockAction, and if the dockable will no longer be used for any method calls (except bind) on this DockAction.

Specified by:
unbind in interface DockAction
Parameters:
dockable - The Dockable that will never be seen again, except it is maybe bind again.

createView

public <V> V createView(ViewTarget<V> target,
                        ActionViewConverter converter,
                        Dockable dockable)
Description copied from interface: DockAction
Creates a view for this action, for the platform target and with help of converter. Clients might use their own code to create a new view, but the preferred way is to call ActionViewConverter.createView(ActionType, DockAction, ViewTarget, Dockable) with an ActionType that fits to this DockAction.

Specified by:
createView in interface DockAction
Type Parameters:
V - the type of view requested
Parameters:
target - The platform on which the view will be used
converter - A set of methods that can be used to create a view
dockable - The Dockable for which the view will be shown. Note that this action may not yet be bound to this action.
Returns:
a new view

trigger

public boolean trigger(Dockable dockable)
Description copied from interface: DockAction
Does the appropriate action that can be done respecting the current state of this action.

Specified by:
trigger in interface DockAction
Parameters:
dockable - the element for which this action is called
Returns:
true if this action could do anything, false if this action was not able to react in any way to the event.