bibliothek.gui.dock.common.grouping
Class GroupingHistoryRewriter

java.lang.Object
  extended by bibliothek.gui.dock.common.grouping.GroupingHistoryRewriter
All Implemented Interfaces:
HistoryRewriter<Location,CLocationMode>

public class GroupingHistoryRewriter
extends Object
implements HistoryRewriter<Location,CLocationMode>

This HistoryRewriter gets the current CGroupingBehavior using the key CControl.GROUPING_BEHAVIOR from its CControl. It then accesses the DockableGrouping of a Dockable to rewrite its history. This rewriter makes use of another HistoryRewriter called "validation", to make sure that a valid location is created.
Clients should not have any need to create instances of this class, because any CControl will already have a GroupingHistoryRewriter pre-installed.

Author:
Benjamin Sigg

Constructor Summary
GroupingHistoryRewriter(CControl control, HistoryRewriter<Location,CLocationMode> validation)
          Creates a new GroupingHistoryRewriter.
 
Method Summary
 Location rewrite(Dockable dockable, CLocationMode mode, Location history)
          Checks whether the history object history is still valid.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupingHistoryRewriter

public GroupingHistoryRewriter(CControl control,
                               HistoryRewriter<Location,CLocationMode> validation)
Creates a new GroupingHistoryRewriter.

Parameters:
control - the CControl in whose realm this history rewriter works
validation - a rewriter that will be used to validate the location of dockables
Method Detail

rewrite

public Location rewrite(Dockable dockable,
                        CLocationMode mode,
                        Location history)
Description copied from interface: HistoryRewriter
Checks whether the history object history is still valid.

Specified by:
rewrite in interface HistoryRewriter<Location,CLocationMode>
Parameters:
dockable - the element which is about to change its mode
mode - the mode that is going to be applied
history - the history object that will be forwarded to mode, may be null
Returns:
the history object to use, may be null