qx.event.handler
Class DragAndDropHandler

java.lang.Object
  extended by qx.core.Object
      extended by qx.core.Target
          extended by qx.util.manager.Object
              extended by qx.event.handler.DragAndDropHandler

public class DragAndDropHandler
extends Object

This manager (singleton) manage all drag and drop handling of a qx.core.Init instance.


Constructor Summary
DragAndDropHandler()
           
 
Method Summary
 void _applyDestinationWidget(java.lang.Object value, java.lang.Object old)
           
 void _endDrag(java.lang.Object currentDestinationWidget, Event e)
          This will be called to the end of each drag and drop session
 void _endDragCore()
           
 java.lang.Object _evalNewAction(java.lang.Object vKeyShift, java.lang.Object vKeyCtrl, java.lang.Object vKeyAlt)
           
 void _fireUserEvents(java.lang.Object fromWidget, java.lang.Object toWidget, Event e)
           
 void _handleKeyDown(Event e)
           
 void _handleKeyUp(Event e)
           
 void _handleMouseDown(Event e)
          This starts the core drag and drop session.
 void _handleMouseMove(Event e)
          Handler for mouse move events
 void _handleMouseUp(Event e)
          Handle mouse up event.
 void _renderCursor()
          Select and setup the current used cursor
 void _renderFeedbackWidget()
          Renders the user feedback widget at the correct location.
 void addAction(java.lang.Object vAction, java.lang.Object vForce)
           
 void addData(java.lang.Object vMimeType, java.lang.Object vData)
          Add data of mimetype.
 void cancelDrag(Event e)
          Cancel current drag and drop session
 void clearActions()
           
 void clearData()
           
 java.lang.String getCurrentAction()
          Returns the (computed) value of the property currentAction.
 java.lang.Object getData(java.lang.Object vMimeType)
           
 java.lang.Integer getDefaultCursorDeltaX()
          Returns the (computed) value of the property defaultCursorDeltaX.
 java.lang.Integer getDefaultCursorDeltaY()
          Returns the (computed) value of the property defaultCursorDeltaY.
 Widget getDestinationWidget()
          Returns the (computed) value of the property destinationWidget.
 java.lang.Object getDropDataTypes()
           
 void getDropTarget(java.lang.Object e)
           
 Widget getSourceWidget()
          Returns the (computed) value of the property sourceWidget.
 void globalCancelDrag()
           
 void handleKeyEvent(Event e)
          This wraps the key events to custom handlers.
 java.lang.Object handleMouseEvent(Event e)
          This wraps the mouse events to custom handlers.
 void initCurrentAction(java.lang.String arg)
          Calls the apply method and dispatches the change event of the property currentAction with the default value defined by the class developer.
 void initDefaultCursorDeltaX(java.lang.Integer arg)
          Calls the apply method and dispatches the change event of the property defaultCursorDeltaX with the default value defined by the class developer.
 void initDefaultCursorDeltaY(java.lang.Integer arg)
          Calls the apply method and dispatches the change event of the property defaultCursorDeltaY with the default value defined by the class developer.
 void initDestinationWidget(Widget arg)
          Calls the apply method and dispatches the change event of the property destinationWidget with the default value defined by the class developer.
 void initSourceWidget(Widget arg)
          Calls the apply method and dispatches the change event of the property sourceWidget with the default value defined by the class developer.
 void removeAction(java.lang.Object vAction)
           
 void resetCurrentAction()
          Resets the user value of the property currentAction.
 void resetDefaultCursorDeltaX()
          Resets the user value of the property defaultCursorDeltaX.
 void resetDefaultCursorDeltaY()
          Resets the user value of the property defaultCursorDeltaY.
 void resetDestinationWidget()
          Resets the user value of the property destinationWidget.
 void resetSourceWidget()
          Resets the user value of the property sourceWidget.
 void setAction(java.lang.Object vAction)
           
 void setCurrentAction(java.lang.String arg)
          Sets the user value of the property currentAction.
 void setCursorPosition(int deltaX, int deltaY)
          Sets the position of the cursor feedback (the icon showing whether dropping is allowed at the current position and which action a drop will do).
 void setDefaultCursorDeltaX(java.lang.Integer arg)
          Sets the user value of the property defaultCursorDeltaX.
 void setDefaultCursorDeltaY(java.lang.Integer arg)
          Sets the user value of the property defaultCursorDeltaY.
 void setDestinationWidget(Widget arg)
          Sets the user value of the property destinationWidget.
 void setFeedbackWidget(Widget widget, int deltaX, int deltaY, boolean autoDisposeWidget)
          Sets the widget to show as feedback for the user.
 void setSourceWidget(Widget arg)
          Sets the user value of the property sourceWidget.
 void startDrag()
          This needed be called from any “dragstart” event to really start drag session.
 void supportsDrop(java.lang.Object vWidget)
           
 
Methods inherited from class qx.util.manager.Object
add, disableAll, enableAll, get, getAll, has, remove
 
Methods inherited from class qx.core.Target
_dispatchEvent, addChangeSelectionListener, addChangeValueListener, addEventListener, addExecuteListener, addJavaEventListener, createDispatchChangeEvent, createDispatchDataEvent, createDispatchEvent, dispatchEvent, hasEventListeners, removeEventListener
 
Methods inherited from class qx.core.Object
_disposeFields, _disposeObjectDeep, _disposeObjects, base, dispose, get, getDisposed, isDisposed, reset, self, set, toHashCode, toString_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DragAndDropHandler

public DragAndDropHandler()
Method Detail

_applyDestinationWidget

public void _applyDestinationWidget(java.lang.Object value,
                                    java.lang.Object old)

_endDrag

public void _endDrag(java.lang.Object currentDestinationWidget,
                     Event e)

This will be called to the end of each drag and drop session


_endDragCore

public void _endDragCore()

_evalNewAction

public java.lang.Object _evalNewAction(java.lang.Object vKeyShift,
                                       java.lang.Object vKeyCtrl,
                                       java.lang.Object vKeyAlt)

_fireUserEvents

public void _fireUserEvents(java.lang.Object fromWidget,
                            java.lang.Object toWidget,
                            Event e)

_handleKeyDown

public void _handleKeyDown(Event e)

_handleKeyUp

public void _handleKeyUp(Event e)

_handleMouseDown

public void _handleMouseDown(Event e)

This starts the core drag and drop session.

To really get drag and drop working you need to define a function which you attach to “dragstart”-event, which invokes at least this.startDrag()


_handleMouseMove

public void _handleMouseMove(Event e)

Handler for mouse move events


_handleMouseUp

public void _handleMouseUp(Event e)

Handle mouse up event. Normally this finalize the drag and drop event.


_renderCursor

public void _renderCursor()

Select and setup the current used cursor


_renderFeedbackWidget

public void _renderFeedbackWidget()

Renders the user feedback widget at the correct location.


addAction

public void addAction(java.lang.Object vAction,
                      java.lang.Object vForce)

addData

public void addData(java.lang.Object vMimeType,
                    java.lang.Object vData)

Add data of mimetype.

#param vMimeType[String]: A valid mimetype #param vData[Any]: Any value for the mimetype


cancelDrag

public void cancelDrag(Event e)

Cancel current drag and drop session


clearActions

public void clearActions()

clearData

public void clearData()

getCurrentAction

public java.lang.String getCurrentAction()

Returns the (computed) value of the property currentAction.

For further details take a look at the property definition: currentAction.


getData

public java.lang.Object getData(java.lang.Object vMimeType)

getDefaultCursorDeltaX

public java.lang.Integer getDefaultCursorDeltaX()

Returns the (computed) value of the property defaultCursorDeltaX.

For further details take a look at the property definition: defaultCursorDeltaX.


getDefaultCursorDeltaY

public java.lang.Integer getDefaultCursorDeltaY()

Returns the (computed) value of the property defaultCursorDeltaY.

For further details take a look at the property definition: defaultCursorDeltaY.


getDestinationWidget

public Widget getDestinationWidget()

Returns the (computed) value of the property destinationWidget.

For further details take a look at the property definition: destinationWidget.


getDropDataTypes

public java.lang.Object getDropDataTypes()

getDropTarget

public void getDropTarget(java.lang.Object e)

getSourceWidget

public Widget getSourceWidget()

Returns the (computed) value of the property sourceWidget.

For further details take a look at the property definition: sourceWidget.


globalCancelDrag

public void globalCancelDrag()

handleKeyEvent

public void handleKeyEvent(Event e)

This wraps the key events to custom handlers.


handleMouseEvent

public java.lang.Object handleMouseEvent(Event e)

This wraps the mouse events to custom handlers.


initCurrentAction

public void initCurrentAction(java.lang.String arg)

Calls the apply method and dispatches the change event of the property currentAction with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: currentAction.


initDefaultCursorDeltaX

public void initDefaultCursorDeltaX(java.lang.Integer arg)

Calls the apply method and dispatches the change event of the property defaultCursorDeltaX with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: defaultCursorDeltaX.


initDefaultCursorDeltaY

public void initDefaultCursorDeltaY(java.lang.Integer arg)

Calls the apply method and dispatches the change event of the property defaultCursorDeltaY with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: defaultCursorDeltaY.


initDestinationWidget

public void initDestinationWidget(Widget arg)

Calls the apply method and dispatches the change event of the property destinationWidget with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: destinationWidget.


initSourceWidget

public void initSourceWidget(Widget arg)

Calls the apply method and dispatches the change event of the property sourceWidget with the default value defined by the class developer. This function can only be called from the constructor of a class.

For further details take a look at the property definition: sourceWidget.


removeAction

public void removeAction(java.lang.Object vAction)

resetCurrentAction

public void resetCurrentAction()

Resets the user value of the property currentAction.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: currentAction.


resetDefaultCursorDeltaX

public void resetDefaultCursorDeltaX()

Resets the user value of the property defaultCursorDeltaX.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: defaultCursorDeltaX.


resetDefaultCursorDeltaY

public void resetDefaultCursorDeltaY()

Resets the user value of the property defaultCursorDeltaY.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: defaultCursorDeltaY.


resetDestinationWidget

public void resetDestinationWidget()

Resets the user value of the property destinationWidget.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: destinationWidget.


resetSourceWidget

public void resetSourceWidget()

Resets the user value of the property sourceWidget.

The computed value falls back to the next available value e.g. appearance, init or inheritance value depeneding on the property configuration and value availability.

For further details take a look at the property definition: sourceWidget.


setAction

public void setAction(java.lang.Object vAction)

setCurrentAction

public void setCurrentAction(java.lang.String arg)

Sets the user value of the property currentAction.

For further details take a look at the property definition: currentAction.


setCursorPosition

public void setCursorPosition(int deltaX,
                              int deltaY)

Sets the position of the cursor feedback (the icon showing whether dropping is allowed at the current position and which action a drop will do).


setDefaultCursorDeltaX

public void setDefaultCursorDeltaX(java.lang.Integer arg)

Sets the user value of the property defaultCursorDeltaX.

For further details take a look at the property definition: defaultCursorDeltaX.


setDefaultCursorDeltaY

public void setDefaultCursorDeltaY(java.lang.Integer arg)

Sets the user value of the property defaultCursorDeltaY.

For further details take a look at the property definition: defaultCursorDeltaY.


setDestinationWidget

public void setDestinationWidget(Widget arg)

Sets the user value of the property destinationWidget.

For further details take a look at the property definition: destinationWidget.


setFeedbackWidget

public void setFeedbackWidget(Widget widget,
                              int deltaX,
                              int deltaY,
                              boolean autoDisposeWidget)

Sets the widget to show as feedback for the user. This widget should represent the object(s) the user is dragging.


setSourceWidget

public void setSourceWidget(Widget arg)

Sets the user value of the property sourceWidget.

For further details take a look at the property definition: sourceWidget.


startDrag

public void startDrag()

This needed be called from any “dragstart” event to really start drag session.


supportsDrop

public void supportsDrop(java.lang.Object vWidget)


Copyright © 2008 1&1. All Rights Reserved.