Package bibliothek.gui.dock.facile.mode
Class MappingLocationModeActionProvider
java.lang.Object
bibliothek.gui.dock.facile.mode.MappingLocationModeActionProvider
- All Implemented Interfaces:
LocationModeActionProvider
public abstract class MappingLocationModeActionProvider
extends Object
implements LocationModeActionProvider
This
LocationModeActionProvider mimics a map with keys managed by
a subclass. In its getActions(Dockable, Mode, DockActionSource)
method it selects the one provider whose key matches the current mode to provide the actions.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddestroy(Dockable dockable, DockActionSource source) Called ifdockableis no longer in use and all references todockableare to be removed.getActions(Dockable dockable, Mode<Location> currentMode, DockActionSource currentSource) Called if the elementdockable, which is currently in modemode, should have some additionalDockActions related to the owner of thisLocationModeActionProvider.protected abstract LocationModeActionProvidergetProvider(Dockable dockable, Mode<Location> currentMode, DockActionSource currentSource) Gets theLocationModeActionProviderwhich fits the key generated by the arguments of this method.
-
Constructor Details
-
MappingLocationModeActionProvider
public MappingLocationModeActionProvider()
-
-
Method Details
-
destroy
Description copied from interface:LocationModeActionProviderCalled ifdockableis no longer in use and all references todockableare to be removed.- Specified by:
destroyin interfaceLocationModeActionProvider- Parameters:
dockable- the element which is no longer handled by the owning modesource- the last result ofgetActions, may benull
-
getActions
public DockActionSource getActions(Dockable dockable, Mode<Location> currentMode, DockActionSource currentSource) Description copied from interface:LocationModeActionProviderCalled if the elementdockable, which is currently in modemode, should have some additionalDockActions related to the owner of thisLocationModeActionProvider.- Specified by:
getActionsin interfaceLocationModeActionProvider- Parameters:
dockable- the element for which an action source is requiredcurrentMode- the current mode ofdockablecurrentSource- the source that was returned by this method in the previous call. May benulleither if this method returnednullor was not yet called fordockable- Returns:
- the source or
nullif the default value should be used
-
getProvider
protected abstract LocationModeActionProvider getProvider(Dockable dockable, Mode<Location> currentMode, DockActionSource currentSource) Gets theLocationModeActionProviderwhich fits the key generated by the arguments of this method.- Parameters:
dockable- the element for which the actions will be usedcurrentMode- the current mode ofdockablecurrentSource- the current actions ofdockable- Returns:
- the provider or
null
-