com.allen_sauer.gwt.dnd.client
Interface DragController

All Superinterfaces:
FiresDragEvents
All Known Implementing Classes:
AbstractDragController, PickupDragController, SwtDragController

public interface DragController
extends FiresDragEvents

Common interface which all drag controllers must implement.


Method Summary
 void addDragHandler(DragHandler handler)
          Register a drag handler which will listen for DragStartEvents and and DragEndEvents.
 void clearSelection()
          All currently selected widgets are deselected.
 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 getBehaviorCancelDocumentSelections()
          Whether or not any selected regions should be unselected by dragging.
 boolean getBehaviorConstrainedToBoundaryPanel()
          Determine whether or not drag operations are constrained to the boundary panel.
 int getBehaviorDragStartSensitivity()
          Gets the number of pixels the mouse must be moved to initiate a drag operation.
 boolean getBehaviorMultipleSelection()
          Determines whether multiple widget selection behavior is enabled.
 boolean getBehaviorScrollIntoView()
          Determines whether containing panels and the browser window should be scrolled during dragging in order to keep draggable widgets visible.
 com.google.gwt.user.client.ui.AbsolutePanel getBoundaryPanel()
          Get the boundary panel provided in the constructor.
 void makeDraggable(com.google.gwt.user.client.ui.Widget draggable)
          Enable dragging on widget.
 void makeDraggable(com.google.gwt.user.client.ui.Widget draggable, com.google.gwt.user.client.ui.Widget dragHandle)
          Enable dragging on widget, specifying the child widget serving as a drag handle.
 void makeNotDraggable(com.google.gwt.user.client.ui.Widget widget)
          Performs the reverse of makeDraggable(Widget), making the widget no longer draggable by this drag controller.
 void previewDragEnd()
          Callback method for MouseDragHandler.
 void previewDragStart()
          Callback method for MouseDragHandler.
 void removeDragHandler(DragHandler handler)
          Unregister drag handler.
 void resetCache()
          Reset the internal drop controller (drop target) cache which is initialized primarily by AbstractDragController.dragStart().
 void setBehaviorCancelDocumentSelections(boolean cancelDocumentSelections)
          Set whether or not document selections should be canceled by dragging.
 void setBehaviorConstrainedToBoundaryPanel(boolean constrainedToBoundaryPanel)
          Set whether or not movable widget is to be constrained to the boundary panel during dragging.
 void setBehaviorDragStartSensitivity(int pixels)
          Sets the number of pixels the mouse must be moved in either horizontal or vertical direction in order to initiate a drag operation.
 void setBehaviorMultipleSelection(boolean multipleSelectionAllowed)
          Sets whether multiple widgets can be selected for dragging at one time via CTRL/ META-click.
 void setBehaviorScrollIntoView(boolean scrollIntoView)
          Set whether or not to scroll containing panels and the browser window during drag operations in order to keep the draggable widgets visible.
 void toggleSelection(com.google.gwt.user.client.ui.Widget draggable)
          Toggle the selection of the specified widget.
 

Method Detail

addDragHandler

void addDragHandler(DragHandler handler)
Register a drag handler which will listen for DragStartEvents and and DragEndEvents.

Specified by:
addDragHandler in interface FiresDragEvents
Parameters:
handler - the drag handler to register
See Also:
removeDragHandler(DragHandler)

clearSelection

void clearSelection()
All currently selected widgets are deselected.


dragEnd

void dragEnd()
Callback method for MouseDragHandler.


dragMove

void dragMove()
Callback method for MouseDragHandler.


dragStart

void dragStart()
Callback method for MouseDragHandler when a drag operation is initiated for this drag controller.


getBehaviorCancelDocumentSelections

boolean getBehaviorCancelDocumentSelections()
Whether or not any selected regions should be unselected by dragging.

Returns:
true if cancel selections behavior in on

getBehaviorConstrainedToBoundaryPanel

boolean getBehaviorConstrainedToBoundaryPanel()
Determine whether or not drag operations are constrained to the boundary panel.

Returns:
true if drags are constrained to the boundary panel

getBehaviorDragStartSensitivity

int getBehaviorDragStartSensitivity()
Gets the number of pixels the mouse must be moved to initiate a drag operation.

Returns:
number of pixels or 0 (zero) if mouse down starts the drag

getBehaviorMultipleSelection

boolean getBehaviorMultipleSelection()
Determines whether multiple widget selection behavior is enabled.

Returns:
true if multiple widget selection behavior is enabled

getBehaviorScrollIntoView

boolean getBehaviorScrollIntoView()
Determines whether containing panels and the browser window should be scrolled during dragging in order to keep draggable widgets visible.

Returns:
true if containing panels and the browser window are to be scrolled during dragging to keep draggable widgets visible

getBoundaryPanel

com.google.gwt.user.client.ui.AbsolutePanel getBoundaryPanel()
Get the boundary panel provided in the constructor.

Returns:
the AbsolutePanel provided in the constructor

makeDraggable

void makeDraggable(com.google.gwt.user.client.ui.Widget draggable)
Enable dragging on widget. Call this method for each widget that you would like to make draggable under this drag controller.

Parameters:
draggable - the widget to be made draggable

makeDraggable

void makeDraggable(com.google.gwt.user.client.ui.Widget draggable,
                   com.google.gwt.user.client.ui.Widget dragHandle)
Enable dragging on widget, specifying the child widget serving as a drag handle.

Parameters:
draggable - the widget to be made draggable
dragHandle - the widget by which widget can be dragged

makeNotDraggable

void makeNotDraggable(com.google.gwt.user.client.ui.Widget widget)
Performs the reverse of makeDraggable(Widget), making the widget no longer draggable by this drag controller.

Parameters:
widget - the widget which should no longer be draggable

previewDragEnd

void previewDragEnd()
                    throws VetoDragException
Callback method for MouseDragHandler.

Throws:
VetoDragException - if the proposed operation is unacceptable

previewDragStart

void previewDragStart()
                      throws VetoDragException
Callback method for MouseDragHandler.

Throws:
VetoDragException - if the proposed operation is unacceptable

removeDragHandler

void removeDragHandler(DragHandler handler)
Unregister drag handler.

Specified by:
removeDragHandler in interface FiresDragEvents
Parameters:
handler - the drag handler to remove
See Also:
addDragHandler(DragHandler)

resetCache

void resetCache()
Reset the internal drop controller (drop target) cache which is initialized primarily by AbstractDragController.dragStart(). This method should be called when a drop target's size and/or location changes, or when drop target eligibility changes.


setBehaviorCancelDocumentSelections

void setBehaviorCancelDocumentSelections(boolean cancelDocumentSelections)
Set whether or not document selections should be canceled by dragging. The default is true.

Parameters:
cancelDocumentSelections - true if dragging should cancel document selections

setBehaviorConstrainedToBoundaryPanel

void setBehaviorConstrainedToBoundaryPanel(boolean constrainedToBoundaryPanel)
Set whether or not movable widget is to be constrained to the boundary panel during dragging. The default is not to constrain the draggable or drag proxy.

Parameters:
constrainedToBoundaryPanel - whether or not to constrain to the boundary panel

setBehaviorDragStartSensitivity

void setBehaviorDragStartSensitivity(int pixels)
Sets the number of pixels the mouse must be moved in either horizontal or vertical direction in order to initiate a drag operation. Defaults to 0 (zero). Use a value of at least 1 (one) in order to allow registered click listeners to receive click events.

Parameters:
pixels - number of pixels or 0 (zero) to start dragging on mouse down

setBehaviorMultipleSelection

void setBehaviorMultipleSelection(boolean multipleSelectionAllowed)
Sets whether multiple widgets can be selected for dragging at one time via CTRL/ META-click. Defaults to true.

Parameters:
multipleSelectionAllowed - whether multiple selections are enabled

setBehaviorScrollIntoView

void setBehaviorScrollIntoView(boolean scrollIntoView)
Set whether or not to scroll containing panels and the browser window during drag operations in order to keep the draggable widgets visible. The default is true.

Parameters:
scrollIntoView - whether or not to scroll panels and browser window to keep draggable widgets visible

toggleSelection

void toggleSelection(com.google.gwt.user.client.ui.Widget draggable)
Toggle the selection of the specified widget.

Parameters:
draggable - the widget whose selection is to be toggled


Copyright © 2011 Sage Software, Inc. All rights reserved.