bibliothek.gui.dock.control.relocator
Class TabMerger

java.lang.Object
  extended by bibliothek.gui.dock.control.relocator.TabMerger
All Implemented Interfaces:
Merger

public class TabMerger
extends Object
implements Merger

This Merger merges StackDockStations that are dropped onto a single tabbed Dockable.

Author:
Benjamin Sigg

Constructor Summary
TabMerger()
           
 
Method Summary
 boolean canMerge(StationDropOperation operation, DockStation parent, DockStation child)
          Checks whether Merger.merge(StationDropOperation, DockStation, DockStation) will succeed or not.
 void merge(StationDropOperation operation, DockStation parent, DockStation child)
          Moves all children of child to parent, leaving child empty.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TabMerger

public TabMerger()
Method Detail

canMerge

public boolean canMerge(StationDropOperation operation,
                        DockStation parent,
                        DockStation child)
Description copied from interface: Merger
Checks whether Merger.merge(StationDropOperation, DockStation, DockStation) will succeed or not. This method will only be called if parent would accept all children of child. This method may be called during "drop" and during "move" operations.

Specified by:
canMerge in interface Merger
Parameters:
operation - the operation that would be executed, can be null
parent - an existing station
child - a station that is dragged around and may be dropped onto parent
Returns:
whether Merger.merge(StationDropOperation, DockStation, DockStation) will succeed

merge

public void merge(StationDropOperation operation,
                  DockStation parent,
                  DockStation child)
Description copied from interface: Merger
Moves all children of child to parent, leaving child empty. This method is only called if canMerge returned true and if the accept-methods allow the operation.
If the parent of child is not parent, then child will be removed from its parent. Otherwise the child remains, allowing this Merger to reuse it.

Specified by:
merge in interface Merger
Parameters:
operation - the operation that would be executed, can be null
parent - the new parent of the children
child - the station to disolve