org.mobicents.servlet.management.client.dnd
Class PickupDragController

java.lang.Object
  extended by com.allen_sauer.gwt.dnd.client.AbstractDragController
      extended by org.mobicents.servlet.management.client.dnd.PickupDragController
All Implemented Interfaces:
com.allen_sauer.gwt.dnd.client.DragController, com.allen_sauer.gwt.dnd.client.FiresDragEvents

public class PickupDragController
extends com.allen_sauer.gwt.dnd.client.AbstractDragController

DragController used for drag-and-drop operations where a draggable widget or drag proxy is temporarily picked up and dragged around the boundary panel. Be sure to register a DropController for each drop target.

See Also:
registerDropController(DropController)

Field Summary
 
Fields inherited from class com.allen_sauer.gwt.dnd.client.AbstractDragController
context, CSS_DRAGGABLE, CSS_DRAGGING, CSS_HANDLE
 
Constructor Summary
PickupDragController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel, boolean allowDroppingOnBoundaryPanel)
          Create a new pickup-and-move style drag controller.
 
Method Summary
 void dragEnd()
           
 void dragMove()
           
 void dragStart()
           
 boolean getBehaviorBoundaryPanelDrop()
          Whether or not dropping on the boundary panel is permitted.
 boolean getBehaviorDragProxy()
          Determine whether or not this controller automatically creates a drag proxy for each drag operation.
protected  com.allen_sauer.gwt.dnd.client.drop.BoundaryDropController newBoundaryDropController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel, boolean allowDroppingOnBoundaryPanel)
          Create a new BoundaryDropController to manage our boundary panel as a drop target.
protected  com.google.gwt.user.client.ui.Widget newDragProxy(com.allen_sauer.gwt.dnd.client.DragContext context)
          Called by AbstractDragController.dragStart(Widget) to allow subclasses to provide their own drag proxies.
 void previewDragEnd()
           
 void registerDropController(com.allen_sauer.gwt.dnd.client.drop.DropController dropController)
          Register a new DropController, representing a new drop target, with this drag controller.
 void resetCache()
           
protected  void restoreSelectedWidgetsLocation()
          Restore the selected widgets to their original location.
protected  void restoreSelectedWidgetsStyle()
          Restore the selected widgets with their original style.
protected  void saveSelectedWidgetsLocationAndStyle()
          Save the selected widgets' current location in case they much be restored due to a cancelled drop.
 void setBehaviorBoundaryPanelDrop(boolean allowDroppingOnBoundaryPanel)
          Set whether or not widgets may be dropped anywhere on the boundary panel.
 void setBehaviorDragProxy(boolean dragProxyEnabled)
          Set whether or not this controller should automatically create a drag proxy for each drag operation.
 void unregisterDropController(com.allen_sauer.gwt.dnd.client.drop.DropController dropController)
          Unregister a DropController from this drag controller.
 
Methods inherited from class com.allen_sauer.gwt.dnd.client.AbstractDragController
addDragHandler, clearSelection, dragEnd, dragStart, getBehaviorConstrainedToBoundaryPanel, getBehaviorDragStartSensitivity, getBehaviorMultipleSelection, getBoundaryPanel, getDropControllerCollection, getIntersectDropController, getIntersectDropController, getMovableWidget, makeDraggable, makeDraggable, makeNotDraggable, newBoundaryDropController, notifyDragEnd, previewDragEnd, previewDragStart, previewDragStart, removeDragHandler, restoreDraggableLocation, restoreDraggableStyle, saveDraggableLocationAndStyle, setBehaviorConstrainedToBoundaryPanel, setBehaviorDragStartSensitivity, setBehaviorMultipleSelection, setConstrainWidgetToBoundaryPanel, toggleSelection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PickupDragController

public PickupDragController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel,
                            boolean allowDroppingOnBoundaryPanel)
Create a new pickup-and-move style drag controller. Allows widgets or a suitable proxy to be temporarily picked up and moved around the specified boundary panel.

Note: An implicit BoundaryDropController is created and registered automatically.

Parameters:
boundaryPanel - the desired boundary panel or RootPanel.get() if entire document body is to be the boundary
allowDroppingOnBoundaryPanel - whether or not boundary panel should allow dropping
Method Detail

dragEnd

public void dragEnd()
Specified by:
dragEnd in interface com.allen_sauer.gwt.dnd.client.DragController
Overrides:
dragEnd in class com.allen_sauer.gwt.dnd.client.AbstractDragController

dragMove

public void dragMove()

dragStart

public void dragStart()
Specified by:
dragStart in interface com.allen_sauer.gwt.dnd.client.DragController
Overrides:
dragStart in class com.allen_sauer.gwt.dnd.client.AbstractDragController

getBehaviorBoundaryPanelDrop

public boolean getBehaviorBoundaryPanelDrop()
Whether or not dropping on the boundary panel is permitted.

Returns:
true if dropping on the boundary panel is allowed

getBehaviorDragProxy

public boolean getBehaviorDragProxy()
Determine whether or not this controller automatically creates a drag proxy for each drag operation. Whether or not a drag proxy is used is ultimately determined by the return value of #maybeNewDraggableProxy(Widget)

Returns:
true if drag proxy behavior is enabled

previewDragEnd

public void previewDragEnd()
                    throws com.allen_sauer.gwt.dnd.client.VetoDragException
Specified by:
previewDragEnd in interface com.allen_sauer.gwt.dnd.client.DragController
Overrides:
previewDragEnd in class com.allen_sauer.gwt.dnd.client.AbstractDragController
Throws:
com.allen_sauer.gwt.dnd.client.VetoDragException

registerDropController

public void registerDropController(com.allen_sauer.gwt.dnd.client.drop.DropController dropController)
Register a new DropController, representing a new drop target, with this drag controller.

Parameters:
dropController - the controller to register
See Also:
unregisterDropController(DropController)

resetCache

public void resetCache()
Specified by:
resetCache in interface com.allen_sauer.gwt.dnd.client.DragController
Overrides:
resetCache in class com.allen_sauer.gwt.dnd.client.AbstractDragController

setBehaviorBoundaryPanelDrop

public void setBehaviorBoundaryPanelDrop(boolean allowDroppingOnBoundaryPanel)
Set whether or not widgets may be dropped anywhere on the boundary panel. Set to false when you only want explicitly registered drop controllers to accept drops. Defaults to true.

Parameters:
allowDroppingOnBoundaryPanel - true to allow dropping

setBehaviorDragProxy

public void setBehaviorDragProxy(boolean dragProxyEnabled)
Set whether or not this controller should automatically create a drag proxy for each drag operation. Whether or not a drag proxy is used is ultimately determined by the return value of #maybeNewDraggableProxy(Widget).

Parameters:
dragProxyEnabled - true to enable drag proxy behavior

unregisterDropController

public void unregisterDropController(com.allen_sauer.gwt.dnd.client.drop.DropController dropController)
Unregister a DropController from this drag controller.

Parameters:
dropController - the controller to register
See Also:
registerDropController(DropController)

newBoundaryDropController

protected com.allen_sauer.gwt.dnd.client.drop.BoundaryDropController newBoundaryDropController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel,
                                                                                               boolean allowDroppingOnBoundaryPanel)
Create a new BoundaryDropController to manage our boundary panel as a drop target. To ensure that draggable widgets can only be dropped on registered drop targets, set allowDroppingOnBoundaryPanel to false.

Overrides:
newBoundaryDropController in class com.allen_sauer.gwt.dnd.client.AbstractDragController
Parameters:
boundaryPanel - the panel to which our drag-and-drop operations are constrained
allowDroppingOnBoundaryPanel - whether or not dropping is allowed on the boundary panel
Returns:
the new BoundaryDropController

newDragProxy

protected com.google.gwt.user.client.ui.Widget newDragProxy(com.allen_sauer.gwt.dnd.client.DragContext context)
Called by AbstractDragController.dragStart(Widget) to allow subclasses to provide their own drag proxies.

Parameters:
context - the current drag context
Returns:
a new drag proxy

restoreSelectedWidgetsLocation

protected void restoreSelectedWidgetsLocation()
Restore the selected widgets to their original location.

See Also:
saveSelectedWidgetsLocationAndStyle(), restoreSelectedWidgetsStyle()

restoreSelectedWidgetsStyle

protected void restoreSelectedWidgetsStyle()
Restore the selected widgets with their original style.

See Also:
saveSelectedWidgetsLocationAndStyle(), restoreSelectedWidgetsLocation()

saveSelectedWidgetsLocationAndStyle

protected void saveSelectedWidgetsLocationAndStyle()
Save the selected widgets' current location in case they much be restored due to a cancelled drop.

See Also:
restoreSelectedWidgetsLocation()


Copyright © 2010. All Rights Reserved.