Package bibliothek.gui.dock.common.mode
Class CStationContainerHistoryRewriter
java.lang.Object
bibliothek.gui.dock.common.mode.CStationContainerHistoryRewriter
- All Implemented Interfaces:
HistoryRewriter<Location,CLocationMode>
public class CStationContainerHistoryRewriter
extends Object
implements HistoryRewriter<Location,CLocationMode>
The
CStationContainerHistoryRewriter tries to ensure that a CDockable stays on the
same CStationContainer when changing the ExtendedMode.- Author:
- Benjamin Sigg
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CStationContainergetContainer(CStation<?> child) Searches theCStationContainerwhich is the parent ofchild.Gets theCControlthat is using this rewriter.protected CStation<?>getMatchingStation(Dockable dockable, ExtendedMode mode) protected CStation<?>getMatchingStation(Dockable dockable, String root) Given the current location ofdockableand the root station it is going to use, this method decides whichCStationis actually going to be the new parent root station.protected CStation<?>Gets the first parentCStationofdockable.protected CStation<?>getWorkingArea(Dockable dockable) rewrite(Dockable dockable, CLocationMode mode, Location history) Checks whether the history objecthistoryis still valid.
-
Constructor Details
-
CStationContainerHistoryRewriter
Creates a new rewriter- Parameters:
control- provides the list ofCStationContainers to check
-
-
Method Details
-
getControl
Gets theCControlthat is using this rewriter.- Returns:
- the control
-
getMatchingStation
Given the current location ofdockableand the root station it is going to use, this method decides whichCStationis actually going to be the new parent root station.- Parameters:
dockable- the element that is going to be moved aroundroot- the new root station- Returns:
- a replacement for
root, a value ofnullmeans thatrootshould be used.
-
getMatchingStation
- Parameters:
dockable- the element for which a new parent is searchedmode- the modeelementshould be in- Returns:
- the new parent or
null
-
getWorkingArea
- Parameters:
dockable- the element whose working area is searched- Returns:
- the working area or
null
-
getParent
Gets the first parentCStationofdockable.- Parameters:
dockable- some dockable whose parent station is searched- Returns:
- the parent station or
nullif not found
-
getContainer
Searches theCStationContainerwhich is the parent ofchild.- Parameters:
child- someCStationwhose parent is searched- Returns:
- the parent of
childornull
-
rewrite
Description copied from interface:HistoryRewriterChecks whether the history objecthistoryis still valid.- Specified by:
rewritein interfaceHistoryRewriter<Location,CLocationMode> - Parameters:
dockable- the element which is about to change its modemode- the mode that is going to be appliedhistory- the history object that will be forwarded tomode, may benull- Returns:
- the history object to use, may be
null
-