Programmer Reference : Drag and Drop : Simple drag and drop
Simple drag and drop
For most applications, the default settings are acceptable. This section describes the minimum requirements for an application to enable drag and drop.
At a minimum, the application must create the source and target adapters on the appropriate widgets. On the source adapter it does not need to hook the dragStartCallback unless it intends to change the vote, images, or offsets to values other than the defaults or unless it wants to deny drag and drop in certain cases by setting the doit flag to false. An application must hook the dragCompleteCallback to perform the operation. The dragChangeCallback does not need to be hooked, nor does the dragCancelCallback.
On the target adapters, the application only needs to hook the dragOverCallback if it needs to check the kind of items being dragged to ensure that the target widget can receive them or if it does not want the default target vote. It should hook the dropCallback to perform the operation. It does not need to hook the dragLeaveCallback or dragCancelCallback.
Most of the extended widgets are useful without drag and drop, but for EwIconArea widgets, drag and drop is needed just to move the items around within the widget. The EwIconArea widget provides an API to support internal-only drag and drop without having to create a source and target adapter, and without having to hook any callbacks. The method configureForDefaultDragAndDrop automatically does this. It limits drag and drop to only allow the user to move items within the container. If the application requires any additional capabilities, it should not use this simple API, but should create its own adapters and hook the callback accordingly.
Last modified date: 01/29/2015