|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.allen_sauer.gwt.dnd.client.AbstractDragController
public abstract class AbstractDragController
DragController
which performs the bare essentials such as adding/removing styles,
maintaining collections, adding mouse listeners, etc.
Extend this class to implement specialized drag capabilities such table column or panel
resizing. For classic drag-and-drop functionality, i.e. the ability to pickup, move around and
drop widgets, use PickupDragController
.
Field Summary | |
---|---|
protected DragContext |
context
The drag controller's drag context. |
Constructor Summary | |
---|---|
AbstractDragController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel)
Create a new drag-and-drop controller. |
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 |
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. |
com.allen_sauer.gwt.dnd.client.MouseDragHandler |
getMouseDragHandler()
|
void |
makeDraggable(com.google.gwt.user.client.ui.Widget draggable)
Attaches a MouseDragHandler to the widget, applies styles to the draggable and the
handle. |
void |
makeDraggable(com.google.gwt.user.client.ui.Widget draggable,
com.google.gwt.user.client.ui.Widget dragHandle)
Similar to makeDraggable(Widget) , but allow separate, child to be specified as the
drag handle by which the first widget can be dragged. |
void |
makeNotDraggable(com.google.gwt.user.client.ui.Widget draggable)
Performs the reverse of makeDraggable(Widget) , detaching the MouseDragHandler
from the widget and removing any styling which was applied when making the widget draggable. |
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 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 |
setConstrainWidgetToBoundaryPanel(boolean constrainWidgetToBoundaryPanel)
|
void |
toggleSelection(com.google.gwt.user.client.ui.Widget draggable)
Toggle the selection of the specified widget. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.allen_sauer.gwt.dnd.client.DragController |
---|
dragMove |
Field Detail |
---|
protected final DragContext context
Constructor Detail |
---|
public AbstractDragController(com.google.gwt.user.client.ui.AbsolutePanel boundaryPanel)
boundaryPanel
- the desired boundary panel or RootPanel.get()
if entire
document body is to be the boundaryMethod Detail |
---|
public final void addDragHandler(DragHandler handler)
DragController
DragStartEvents
and and
DragEndEvents
.
addDragHandler
in interface DragController
addDragHandler
in interface FiresDragEvents
handler
- the drag handler to registerDragController.removeDragHandler(DragHandler)
public void clearSelection()
DragController
clearSelection
in interface DragController
public void dragEnd()
DragController
MouseDragHandler
.
dragEnd
in interface DragController
public void dragStart()
DragController
MouseDragHandler
when a drag operation is initiated for this drag
controller.
dragStart
in interface DragController
public boolean getBehaviorCancelDocumentSelections()
DragController
getBehaviorCancelDocumentSelections
in interface DragController
true
if cancel selections behavior in onpublic boolean getBehaviorConstrainedToBoundaryPanel()
DragController
getBehaviorConstrainedToBoundaryPanel
in interface DragController
true
if drags are constrained to the boundary panelpublic int getBehaviorDragStartSensitivity()
DragController
getBehaviorDragStartSensitivity
in interface DragController
0
(zero) if mouse down starts the dragpublic boolean getBehaviorMultipleSelection()
DragController
getBehaviorMultipleSelection
in interface DragController
true
if multiple widget selection behavior is enabledpublic boolean getBehaviorScrollIntoView()
DragController
getBehaviorScrollIntoView
in interface DragController
true
if containing panels and the browser window are to be scrolled during
dragging to keep draggable widgets visiblepublic final com.google.gwt.user.client.ui.AbsolutePanel getBoundaryPanel()
DragController
getBoundaryPanel
in interface DragController
public void makeDraggable(com.google.gwt.user.client.ui.Widget draggable)
MouseDragHandler
to the widget, applies styles to the draggable and the
handle.
makeDraggable
in interface DragController
draggable
- the widget to be made draggablemakeDraggable(Widget, Widget)
,
HasDragHandle
public void makeDraggable(com.google.gwt.user.client.ui.Widget draggable, com.google.gwt.user.client.ui.Widget dragHandle)
makeDraggable(Widget)
, but allow separate, child to be specified as the
drag handle by which the first widget can be dragged.
makeDraggable
in interface DragController
draggable
- the widget to be made draggabledragHandle
- the widget by which widget can be draggedpublic void makeNotDraggable(com.google.gwt.user.client.ui.Widget draggable)
makeDraggable(Widget)
, detaching the MouseDragHandler
from the widget and removing any styling which was applied when making the widget draggable.
makeNotDraggable
in interface DragController
draggable
- the widget to no longer be draggablepublic void previewDragEnd() throws VetoDragException
DragController
MouseDragHandler
.
previewDragEnd
in interface DragController
VetoDragException
- if the proposed operation is unacceptablepublic void previewDragStart() throws VetoDragException
DragController
MouseDragHandler
.
previewDragStart
in interface DragController
VetoDragException
- if the proposed operation is unacceptablepublic final void removeDragHandler(DragHandler handler)
DragController
removeDragHandler
in interface DragController
removeDragHandler
in interface FiresDragEvents
handler
- the drag handler to removeDragController.addDragHandler(DragHandler)
public void resetCache()
DragController
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 DragController
public void setBehaviorCancelDocumentSelections(boolean cancelDocumentSelections)
DragController
true
.
setBehaviorCancelDocumentSelections
in interface DragController
cancelDocumentSelections
- true
if dragging should cancel document selectionspublic void setBehaviorConstrainedToBoundaryPanel(boolean constrainedToBoundaryPanel)
DragController
setBehaviorConstrainedToBoundaryPanel
in interface DragController
constrainedToBoundaryPanel
- whether or not to constrain to the boundary panelpublic void setBehaviorDragStartSensitivity(int pixels)
DragController
0
(zero). Use a value of at least
1
(one) in order to allow registered click listeners to receive click events.
setBehaviorDragStartSensitivity
in interface DragController
pixels
- number of pixels or 0
(zero) to start dragging on mouse downpublic void setBehaviorMultipleSelection(boolean multipleSelectionAllowed)
DragController
CTRL
/
META
-click. Defaults to true
.
setBehaviorMultipleSelection
in interface DragController
multipleSelectionAllowed
- whether multiple selections are enabledpublic void setBehaviorScrollIntoView(boolean scrollIntoView)
DragController
true
.
setBehaviorScrollIntoView
in interface DragController
scrollIntoView
- whether or not to scroll panels and browser window to keep draggable
widgets visiblepublic void setConstrainWidgetToBoundaryPanel(boolean constrainWidgetToBoundaryPanel)
public void toggleSelection(com.google.gwt.user.client.ui.Widget draggable)
DragController
toggleSelection
in interface DragController
draggable
- the widget whose selection is to be toggledpublic com.allen_sauer.gwt.dnd.client.MouseDragHandler getMouseDragHandler()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |