Define the type of Drag & Drop operation.


   operation STRING )
  1. operation is the name of a drag & drop operation.


Drag & drop actions can be of different kinds; you can do a copy of the dragged object, or move the dragged object from the source to the destination.

Use the setOperation() method to define/force the type of drag & drop operation or to deny/cancel the drag & drop process.


The addPossibleOperation() method can be used to specify additional drag & drop operations that are possible in this dialog.

Table 1. Parameters for the setOperation() method
Parameter Value Description
NULL To deny/cancel the drag & drop process.
copy To allow drag & drop as a copy of the source object.
move To allow drag & drop as a move of the source object.

The setOperation() method can be called in different drag & drop triggers.

A common usage is to deny drag & drop by passing NULL in the ON DRAG_ENTER and/or ON DRAG_OVER blocks because the dragged object does not correspond to the type of objects the target can receive.

This method is also used in ON DRAG_START to force a specific type of drag & drop operation (copy or move), or to deny drag start if the context does not allow a drag & drop action.

When called in the ON DRAG_ENTER block, the method forces a specific drag & drop operation.