bibliothek.gui.dock.facile.mode
Class DefaultLocationModeActionProvider

java.lang.Object
  extended by bibliothek.gui.dock.facile.mode.DefaultLocationModeActionProvider
All Implemented Interfaces:
LocationModeActionProvider
Direct Known Subclasses:
KeyedLocationModeActionProvider

public class DefaultLocationModeActionProvider
extends Object
implements LocationModeActionProvider

This default implementation always returns the same DockActionSource to all Dockables. This source contains an exchangeable DockAction.

Author:
Benjamin Sigg

Constructor Summary
DefaultLocationModeActionProvider()
          Creates a new empty provider
DefaultLocationModeActionProvider(CAction action)
          Creates a new provider.
DefaultLocationModeActionProvider(DockAction action)
          Creates a new provider.
 
Method Summary
 void destroy(Dockable dockable, DockActionSource source)
          Called if dockable is no longer in use and all references to dockable are to be removed.
 DockActionSource getActions(Dockable dockable, Mode<Location> mode, DockActionSource source)
          Called if the element dockable, which is currently in mode mode, should have some additional DockActions related to the owner of this LocationModeActionProvider.
 DockAction getSelectModeAction()
          Gets the action which must be triggered in order to activate this mode.
 void setSelectModeAction(CAction action)
          Calls setSelectModeAction(DockAction).
 void setSelectModeAction(DockAction selectModeAction)
          Sets the action which must be triggered in order to activate this mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultLocationModeActionProvider

public DefaultLocationModeActionProvider()
Creates a new empty provider


DefaultLocationModeActionProvider

public DefaultLocationModeActionProvider(CAction action)
Creates a new provider.

Parameters:
action - the action of this provider, may be null
See Also:
setSelectModeAction(CAction)

DefaultLocationModeActionProvider

public DefaultLocationModeActionProvider(DockAction action)
Creates a new provider.

Parameters:
action - the action of this provider, may be null
See Also:
setSelectModeAction(DockAction)
Method Detail

setSelectModeAction

public void setSelectModeAction(CAction action)
Calls setSelectModeAction(DockAction).

Parameters:
action - the new action or null
See Also:
setSelectModeAction(DockAction)

setSelectModeAction

public void setSelectModeAction(DockAction selectModeAction)
Sets the action which must be triggered in order to activate this mode. This action will be returned by getActions(Dockable, Mode, DockActionSource) if the mode is not this. Changes to this property are applied to all visible Dockable.

Parameters:
selectModeAction - the action or null

getSelectModeAction

public DockAction getSelectModeAction()
Gets the action which must be triggered in order to activate this mode.

Returns:
the action or null

getActions

public DockActionSource getActions(Dockable dockable,
                                   Mode<Location> mode,
                                   DockActionSource source)
Description copied from interface: LocationModeActionProvider
Called if the element dockable, which is currently in mode mode, should have some additional DockActions related to the owner of this LocationModeActionProvider.

Specified by:
getActions in interface LocationModeActionProvider
Parameters:
dockable - the element for which an action source is required
mode - the current mode of dockable
source - the source that was returned by this method in the previous call. May be null either if this method returned null or was not yet called for dockable
Returns:
the source or null if the default value should be used

destroy

public void destroy(Dockable dockable,
                    DockActionSource source)
Description copied from interface: LocationModeActionProvider
Called if dockable is no longer in use and all references to dockable are to be removed.

Specified by:
destroy in interface LocationModeActionProvider
Parameters:
dockable - the element which is no longer handled by the owning mode
source - the last result of getActions, may be null