|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sencha.gxt.fx.client.Draggable
public class Draggable
Adds drag behavior to any widget. Drag operations can be initiated from the widget itself, or another widget, such as the header in a dialog.
It is possible to specify event targets that will be ignored. If the target element has theCommonStyles.Styles.nodrag() style (as returned by
CommonStyles.get()) it will not trigger a drag operation.
| Nested Class Summary | |
|---|---|
static interface |
Draggable.DraggableAppearance
|
| Constructor Summary | |
|---|---|
Draggable(Widget dragComponent)
Creates a new draggable instance. |
|
Draggable(Widget dragComponent,
Draggable.DraggableAppearance appearance)
Creates a new draggable instance. |
|
Draggable(Widget dragComponent,
Widget handle)
Create a new draggable instance. |
|
Draggable(Widget dragComponent,
Widget handle,
Draggable.DraggableAppearance appearance)
Create a new draggable instance. |
|
| Method Summary | |
|---|---|
HandlerRegistration |
addDragCancelHandler(DragCancelEvent.DragCancelHandler handler)
Adds a DragCancelEvent.DragCancelHandler handler for DragCancelEvent events. |
HandlerRegistration |
addDragEndHandler(DragEndEvent.DragEndHandler handler)
Adds a DragEndEvent.DragEndHandler handler for DragEndEvent events. |
HandlerRegistration |
addDragHandler(DragHandler handler)
Adds a DragHandler handler for DragStartEvent ,
DragEndEvent, DragCancelEvent, DragMoveEvent
events. |
HandlerRegistration |
addDragMoveHandler(DragMoveEvent.DragMoveHandler handler)
Adds a DragMoveEvent.DragMoveHandler handler for DragMoveEvent
events. |
HandlerRegistration |
addDragStartHandler(DragStartEvent.DragStartHandler handler)
Adds a DragStartEvent.DragStartHandler handler for DragStartEvent events. |
void |
cancelDrag()
Cancels the drag if running. |
Widget |
getContainer()
Returns the drag container. |
Widget |
getDragHandle()
Returns the drag handle. |
Widget |
getDragWidget()
Returns the widget being dragged. |
int |
getStartDragDistance()
Returns the number of pixels the cursor must move before dragging begins. |
boolean |
isConstrainClient()
Returns true if drag is constrained to the viewport. |
boolean |
isConstrainHorizontal()
Returns true if horizontal movement is constrained. |
boolean |
isConstrainVertical()
Returns true if vertical movement is constrained. |
boolean |
isDragging()
Returns true if a drag is in progress. |
boolean |
isEnabled()
Returns true if enabled. |
boolean |
isMoveAfterProxyDrag()
Returns true if the drag widget is moved after a proxy drag. |
boolean |
isSizeProxyToSource()
Returns true if the proxy element is sized to match the drag widget. |
boolean |
isUpdateZIndex()
Returns true if the z-index is updated after a drag. |
boolean |
isUseProxy()
Returns true if proxy element is enabled. |
void |
release()
Removes the drag handles. |
void |
setConstrainClient(boolean constrainClient)
True to set constrain movement to the viewport (defaults to true). |
void |
setConstrainHorizontal(boolean constrainHorizontal)
True to stop horizontal movement (defaults to false). |
void |
setConstrainVertical(boolean constrainVertical)
True to stop vertical movement (defaults to false). |
void |
setContainer(Widget container)
Specifies a container to which the drag widget is constrained. |
void |
setEnabled(boolean enabled)
Enables dragging if the argument is true, and disables it
otherwise. |
void |
setMoveAfterProxyDrag(boolean moveAfterProxyDrag)
True to move source widget after a proxy drag (defaults to true). |
void |
setProxy(XElement element)
Sets the proxy element. |
void |
setProxyStyle(java.lang.String proxyClass)
|
void |
setSizeProxyToSource(boolean sizeProxyToSource)
True to set proxy dimensions the same as the drag widget (defaults to true). |
void |
setStartDragDistance(int startDragDistance)
Specifies how far the cursor must move after mousedown to start dragging (defaults to 2). |
void |
setUpdateZIndex(boolean updateZIndex)
True if the CSS z-index should be updated on the widget being dragged. |
void |
setUseProxy(boolean useProxy)
True to use a proxy widget during drag operation (defaults to true). |
void |
setXConstraint(int left,
int right)
Constrains the horizontal travel. |
void |
setYConstraint(int top,
int bottom)
Constrains the vertical travel. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Draggable(Widget dragComponent)
dragComponent - the widget to be dragged
public Draggable(Widget dragComponent,
Draggable.DraggableAppearance appearance)
dragComponent - the widget to be draggedappearance - the appearance with which to render the component
public Draggable(Widget dragComponent,
Widget handle)
dragComponent - the widget to be draggedhandle - the widget drags will be initiated from
public Draggable(Widget dragComponent,
Widget handle,
Draggable.DraggableAppearance appearance)
dragComponent - the widget to be draggedhandle - the widget drags will be initiated fromappearance - the appearance with which to render the component| Method Detail |
|---|
public HandlerRegistration addDragCancelHandler(DragCancelEvent.DragCancelHandler handler)
DragCancelEvent.HasDragCancelHandlersDragCancelEvent.DragCancelHandler handler for DragCancelEvent events.
addDragCancelHandler in interface DragCancelEvent.HasDragCancelHandlershandler - the handler
public HandlerRegistration addDragEndHandler(DragEndEvent.DragEndHandler handler)
DragEndEvent.HasDragEndHandlersDragEndEvent.DragEndHandler handler for DragEndEvent events.
addDragEndHandler in interface DragEndEvent.HasDragEndHandlershandler - the handler
public HandlerRegistration addDragHandler(DragHandler handler)
DragHandler.HasDragHandlersDragHandler handler for DragStartEvent ,
DragEndEvent, DragCancelEvent, DragMoveEvent
events.
addDragHandler in interface DragHandler.HasDragHandlershandler - the handler
public HandlerRegistration addDragMoveHandler(DragMoveEvent.DragMoveHandler handler)
DragMoveEvent.HasDragMoveHandlersDragMoveEvent.DragMoveHandler handler for DragMoveEvent
events.
addDragMoveHandler in interface DragMoveEvent.HasDragMoveHandlershandler - the handler
public HandlerRegistration addDragStartHandler(DragStartEvent.DragStartHandler handler)
DragStartEvent.HasDragStartHandlersDragStartEvent.DragStartHandler handler for DragStartEvent events.
addDragStartHandler in interface DragStartEvent.HasDragStartHandlershandler - the handler
public void cancelDrag()
public Widget getContainer()
public Widget getDragHandle()
public Widget getDragWidget()
public int getStartDragDistance()
public boolean isConstrainClient()
public boolean isConstrainHorizontal()
public boolean isConstrainVertical()
public boolean isDragging()
true if a drag is in progress.
public boolean isEnabled()
true if enabled.
public boolean isMoveAfterProxyDrag()
public boolean isSizeProxyToSource()
public boolean isUpdateZIndex()
public boolean isUseProxy()
public void release()
public void setConstrainClient(boolean constrainClient)
constrainClient - true to constrain to viewportpublic void setConstrainHorizontal(boolean constrainHorizontal)
constrainHorizontal - true to stop horizontal movementpublic void setConstrainVertical(boolean constrainVertical)
constrainVertical - true to stop vertical movementpublic void setContainer(Widget container)
container - the containerpublic void setEnabled(boolean enabled)
true, and disables it
otherwise.
enabled - the new enabled statepublic void setMoveAfterProxyDrag(boolean moveAfterProxyDrag)
moveAfterProxyDrag - true to move after a proxy dragpublic void setProxy(XElement element)
element - the proxy elementpublic void setProxyStyle(java.lang.String proxyClass)
public void setSizeProxyToSource(boolean sizeProxyToSource)
sizeProxyToSource - true to update proxy sizepublic void setStartDragDistance(int startDragDistance)
startDragDistance - the start distance in pixelspublic void setUpdateZIndex(boolean updateZIndex)
true will ensure that the dragged
element is always displayed over all other widgets (defaults to true).
updateZIndex - true update the z-indexpublic void setUseProxy(boolean useProxy)
useProxy - true use a proxy
public void setXConstraint(int left,
int right)
left - the number of pixels the element can move to the leftright - the number of pixels the element can move to the right
public void setYConstraint(int top,
int bottom)
top - the number of pixels the element can move to the upbottom - the number of pixels the element can move to the down
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||