bibliothek.gui.dock.control.relocator
Class DropOperation

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

public class DropOperation
extends Object
implements RelocateOperation

This operation calls StationDropOperation.execute()

Author:
Benjamin Sigg

Constructor Summary
DropOperation(DockController controller, 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

DropOperation

public DropOperation(DockController controller,
                     DockStation station,
                     StationDropOperation operation,
                     StationDropItem item)
Creates a new operation

Parameters:
controller - the controller in whose realm this operation works
station - the target of this operation
operation - the operation that would be executed by station
item - additional information about the pending drop
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

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

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

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