bibliothek.gui.dock.station.support
Class CombinerWrapper

java.lang.Object
  extended by bibliothek.gui.dock.station.support.CombinerWrapper
All Implemented Interfaces:
Combiner

public class CombinerWrapper
extends java.lang.Object
implements Combiner

A CombinerWrapper encloses a Combiner and uses the combiner as delegate. If the wrapper has no delegate, it uses the DockUI to get a combiner from the current DockTheme.

Author:
Benjamin Sigg

Constructor Summary
CombinerWrapper()
           
 
Method Summary
 Dockable combine(CombinerSource source, CombinerTarget target)
          Merges two Dockables into a new Dockable.
 Combiner getDelegate()
          Gets the delegate of this wrapper.
 CombinerTarget prepare(CombinerSource source, boolean force)
          Prepares information telling how two Dockables may be combined.
 void setDelegate(Combiner delegate)
          Sets the delegate for this wrapper.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CombinerWrapper

public CombinerWrapper()
Method Detail

getDelegate

public Combiner getDelegate()
Gets the delegate of this wrapper.

Returns:
the delegate or null

setDelegate

public void setDelegate(Combiner delegate)
Sets the delegate for this wrapper. The delegate will be used whenever possible.

Parameters:
delegate - the delegate or null if the default combiner should be used

prepare

public CombinerTarget prepare(CombinerSource source,
                              boolean force)
Description copied from interface: Combiner
Prepares information telling how two Dockables may be combined.

Specified by:
prepare in interface Combiner
Parameters:
source - the Dockable which may be combined, their parent station and other helpful information.
force - if true then a combination must happen, otherwise the result may be null indicating that a combination is not desired by this Combiner.
Returns:
How to combine the Dockables, may be null to indicate that a combination is not desired

combine

public Dockable combine(CombinerSource source,
                        CombinerTarget target)
Description copied from interface: Combiner
Merges two Dockables into a new Dockable. This method may set the DockController of the created element in order to initialize it more efficiently.

Specified by:
combine in interface Combiner
Parameters:
source - information about the two Dockables that are going to be merged, not null. This object may or may not have been created by this Combiner, some sanity checks are advised before using it
target - information that was created by Combiner.prepare(CombinerSource, boolean) using source, not null
Returns:
the combined Dockable, not null