|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.unifr.pai.twice.dragndrop.client.DragNDrop
public class DragNDrop
The main entry point of the drag and drop functionality provided for multi-pointer, touch and single-pointer scenarios.
Nested Class Summary | |
---|---|
(package private) static interface |
DragNDrop.DragNDropIntf
The contract interface for the device specific implementations of the drag and drop functionality |
(package private) static class |
DragNDrop.ValueHolder<T>
A helper class to hold a value |
Field Summary | |
---|---|
private static DragNDrop.DragNDropIntf |
handler
The device dependent drag and drop handler implementation (instantiated by deferred binding) |
Constructor Summary | |
---|---|
private |
DragNDrop(com.google.gwt.user.client.ui.Widget w,
int offsetX,
int offsetY,
DragConfiguration conf)
A private constructor to handle the initialization of the handler |
Method Summary | |
---|---|
static void |
makeDraggable(Draggable w)
Registers a widget to be draggable |
static void |
makeDraggable(Draggable w,
DragConfiguration conf)
Registers a widget to be draggable while providing a specific DragConfiguration which shall be applied to the drags for this widget |
static void |
makeDraggable(Draggable w,
DragConfiguration conf,
com.google.gwt.dom.client.Element dragProxyTemplate)
Registers a widget to be draggable while providing a DragConfiguration which shall be applied to the drags for this widget as well as a HTML
element to be a template for the drag proxy (the element which is shown in a semi-transparent way below the mouse pointer during the drag) |
static void |
makeDraggable(Draggable w,
com.google.gwt.dom.client.Element dragProxyTemplate)
Registers a widget to be draggable while providing a HTML element to be a template for the drag proxy (the element which is shown in a semi-transparent way below the mouse pointer during the drag) |
static void |
removeDropHandler(com.google.gwt.event.dom.client.HasMouseOverHandlers w)
Unregisters the widget implementing HasMouseOverHandlers to be a drop handler. |
static void |
setDropHandler(com.google.gwt.event.dom.client.HasMouseOverHandlers w,
DropTargetHandler dropHandler,
boolean hoverAware)
This method allows to register a widget that implements HasMouseOverHandlers to become a drop target. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static DragNDrop.DragNDropIntf handler
Constructor Detail |
---|
private DragNDrop(com.google.gwt.user.client.ui.Widget w, int offsetX, int offsetY, DragConfiguration conf)
handler
w
- - the widget to be draggedoffsetX
- - the offset on the X-axis between the left border of the widget to be dragged and the mouse position on which the drag startedoffsetY
- - the offset on the Y-axis between the top border of the widget to be dragged and the mouse position on which the drag startedconf
- - the configuration of the way how the drag shall be executed (DragConfiguration
)Method Detail |
---|
public static void makeDraggable(Draggable w)
w
- - the widget that shall be made draggablepublic static void makeDraggable(Draggable w, com.google.gwt.dom.client.Element dragProxyTemplate)
w
- - the widget that shall be made draggabledragProxyTemplate
- - a HTML element which acts as a template for the drag proxy of this widget. If not defined, the proxy will be a visual copy of the draggable
widget.public static void makeDraggable(Draggable w, DragConfiguration conf)
DragConfiguration
which shall be applied to the drags for this widget
w
- - the widget that shall be made draggableconf
- - the DragConfiguration
which shall be applied to a drag of this widgetpublic static void makeDraggable(Draggable w, DragConfiguration conf, com.google.gwt.dom.client.Element dragProxyTemplate)
DragConfiguration
which shall be applied to the drags for this widget as well as a HTML
element to be a template for the drag proxy (the element which is shown in a semi-transparent way below the mouse pointer during the drag)
w
- - the widget that shall be made draggableconf
- - the DragConfiguration
which shall be applied to a drag of this widgetdragProxyTemplate
- - a HTML element which acts as a template for the drag proxy of this widget. If not defined, the proxy will be a visual copy of the draggable
widget.public static void setDropHandler(com.google.gwt.event.dom.client.HasMouseOverHandlers w, DropTargetHandler dropHandler, boolean hoverAware)
HasMouseOverHandlers
to become a drop target. The corresponding methods of the provided
DropTargetHandler
will be invoked if a widget is dragged while hovering this widget.
w
- - the widget that shall be registered as a drop targetdropHandler
- - the DropTargetHandler
defining the actions that shall be taken if a widget is dragged while hovering the widgethoverAware
- - to make a drop target aware if a widget hovers it might have negative impact for the performance. If the drop target does not need to react
on the hovering of dragged widgets but only on drops of them while overlaying the widgets area, this property should be set to false. If this
property is set to false, the methods
DropTargetHandler.onHover(String, Widget, Element, com.google.gwt.user.client.Event, Double, Double)
and
DropTargetHandler.onHoverEnd(String, Widget, Element, com.google.gwt.user.client.Event)
will not be triggered.public static void removeDropHandler(com.google.gwt.event.dom.client.HasMouseOverHandlers w)
HasMouseOverHandlers
to be a drop handler.
w
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |