bibliothek.gui.dock.control.relocator
Class MergeOperation

java.lang.Object
  extended by bibliothek.gui.dock.control.relocator.MergeOperation
All Implemented Interfaces:
RelocateOperation

public class MergeOperation
extends Object
implements RelocateOperation

Uses a Merger to merge two DockStations.

Author:
Benjamin Sigg

Constructor Summary
MergeOperation(DockController controller, Merger merger, DockStation station, StationDropOperation operation, StationDropItem item)
          Creates a new operation.
 
Method Summary
 void destroy(RelocateOperation next)
          Informs this operation that it will never be used (again) and that it should release any resources it has acquired.
 boolean execute(Dockable selection, VetoableDockRelocatorListener listener)
          Executes this operation.
 Dockable[] getImplicit(Dockable selection)
          Gets the Dockables whose parent will change due to this operation.
 StationDropOperation getOperation()
          Gets the operation that would be executed by the dock station.
 DockStation getStation()
          Gets the station which is the target of this operation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergeOperation

public MergeOperation(DockController controller,
                      Merger merger,
                      DockStation station,
                      StationDropOperation operation,
                      StationDropItem item)
Creates a new operation.

Parameters:
controller - the controller in whose realm this operation works
merger - the merger that will be used to merge the stations
station - the target of this operation
operation - the operation that would be executed by the station
item - information about the source of the operation
Method Detail

getStation

public DockStation getStation()
Description copied from interface: RelocateOperation
Gets the station which is the target of this operation

Specified by:
getStation in interface RelocateOperation
Returns:
the target, not null

getOperation

public StationDropOperation getOperation()
Description copied from interface: RelocateOperation
Gets the operation that would be executed by the dock station.

Specified by:
getOperation in interface RelocateOperation
Returns:
the operation, not null

destroy

public void destroy(RelocateOperation next)
Description copied from interface: RelocateOperation
Informs this operation that it will never be used (again) and that it should release any resources it has acquired.

Specified by:
destroy in interface RelocateOperation
Parameters:
next - the operation that will be executed next, can be null

getImplicit

public Dockable[] getImplicit(Dockable selection)
Description copied from interface: RelocateOperation
Gets the Dockables whose parent will change due to this operation.

Specified by:
getImplicit in interface RelocateOperation
Parameters:
selection - the element that is moved around
Returns:
the items, must not be null but can be empty

execute

public boolean execute(Dockable selection,
                       VetoableDockRelocatorListener listener)
Description copied from interface: RelocateOperation
Executes this operation. This method must only call the methods dragging and dragged of listener, all other methods will throw an IllegalStateException.

Specified by:
execute in interface RelocateOperation
Parameters:
selection - the element that is moved around
listener - a listener to be informed about events happening because of this operation
Returns:
true if the operation was a success, false if the operation was canceled