public class PickupDragController extends AbstractDragController
context| Constructor and Description |
|---|
PickupDragController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel,
boolean allowDroppingOnBoundaryPanel)
Create a new pickup-and-move style drag controller.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dragEnd()
Callback method for
MouseDragHandler. |
void |
dragMove()
Callback method for
MouseDragHandler. |
void |
dragStart()
Callback method for
MouseDragHandler when a drag operation is initiated for this drag
controller. |
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.
|
java.lang.Iterable<com.google.gwt.user.client.ui.Widget> |
getSelectedWidgets()
Retrieve currently selected widgets.
|
protected 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(DragContext context)
Called by
dragStart() to allow subclasses to provide their own
drag proxies. |
void |
previewDragEnd()
Callback method for
MouseDragHandler. |
void |
registerDropController(DropController dropController)
Register a new DropController, representing a new drop target, with this drag controller.
|
void |
resetCache()
Reset the internal drop controller (drop target) cache which is initialized primarily by
AbstractDragController.dragStart(). |
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(DropController dropController)
Unregister a DropController from this drag controller.
|
void |
unregisterDropControllers()
Unregister all DropControllers from this drag controller.
|
addDragHandler, clearSelection, getBehaviorCancelDocumentSelections, getBehaviorConstrainedToBoundaryPanel, getBehaviorDragStartSensitivity, getBehaviorMultipleSelection, getBehaviorScrollIntoView, getBoundaryPanel, makeDraggable, makeDraggable, makeNotDraggable, previewDragStart, removeDragHandler, setBehaviorCancelDocumentSelections, setBehaviorConstrainedToBoundaryPanel, setBehaviorDragStartSensitivity, setBehaviorMultipleSelection, setBehaviorScrollIntoView, setConstrainWidgetToBoundaryPanel, toggleSelectionpublic PickupDragController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel,
boolean allowDroppingOnBoundaryPanel)
Note: An implicit BoundaryDropController is created and registered automatically.
boundaryPanel - the desired boundary panel or RootPanel.get() (read
http://code.google.com/p/gwt-dnd/wiki/GettingStarted) if entire document body is to be
the boundaryallowDroppingOnBoundaryPanel - whether or not boundary panel should allow droppingpublic void dragEnd()
DragControllerMouseDragHandler.dragEnd in interface DragControllerdragEnd in class AbstractDragControllerpublic void dragMove()
DragControllerMouseDragHandler.public void dragStart()
DragControllerMouseDragHandler when a drag operation is initiated for this drag
controller.dragStart in interface DragControllerdragStart in class AbstractDragControllerpublic boolean getBehaviorBoundaryPanelDrop()
true if dropping on the boundary panel is allowedpublic boolean getBehaviorDragProxy()
true if drag proxy behavior is enabledpublic java.lang.Iterable<com.google.gwt.user.client.ui.Widget> getSelectedWidgets()
public void previewDragEnd()
throws VetoDragException
DragControllerMouseDragHandler.previewDragEnd in interface DragControllerpreviewDragEnd in class AbstractDragControllerVetoDragException - if the proposed operation is unacceptablepublic void registerDropController(DropController dropController)
dropController - the controller to registerunregisterDropController(DropController)public void resetCache()
DragControllerAbstractDragController.dragStart(). This method should be called when a drop target's
size and/or location changes, or when drop target eligibility changes.resetCache in interface DragControllerresetCache in class AbstractDragControllerpublic void setBehaviorBoundaryPanelDrop(boolean allowDroppingOnBoundaryPanel)
false when you only want explicitly registered drop controllers to accept drops.
Defaults to true.allowDroppingOnBoundaryPanel - true to allow droppingpublic void setBehaviorDragProxy(boolean dragProxyEnabled)
dragProxyEnabled - true to enable drag proxy behaviorpublic void unregisterDropController(DropController dropController)
dropController - the controller to registerregisterDropController(DropController),
unregisterDropControllers()public void unregisterDropControllers()
protected BoundaryDropController newBoundaryDropController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel, boolean allowDroppingOnBoundaryPanel)
allowDroppingOnBoundaryPanel to false.boundaryPanel - the panel to which our drag-and-drop operations are constrainedallowDroppingOnBoundaryPanel - whether or not dropping is allowed on the boundary panelprotected com.google.gwt.user.client.ui.Widget newDragProxy(DragContext context)
dragStart() to allow subclasses to provide their own
drag proxies.context - the current drag contextprotected void restoreSelectedWidgetsLocation()
protected void restoreSelectedWidgetsStyle()
protected void saveSelectedWidgetsLocationAndStyle()
restoreSelectedWidgetsLocation()