Package org.eclipse.gef.dnd

# Class DelegatingDragAdapter

java.lang.Object
org.eclipse.jface.util.DelegatingDragAdapter
org.eclipse.gef.dnd.DelegatingDragAdapter

All Implemented Interfaces:
  `EventListener`, `DragSourceListener`

public class DelegatingDragAdapter extends DelegatingDragAdapter
A DragSourceListener that maintains and delegates to a set of `TransferDragSourceListener`s. Each TransferDragSourceListener can then be implemented as if it were the DragSource's only DragSourceListener.

When a native Drag is started, a subset of all `TransferDragSourceListeners` is generated and stored in a list of active listeners. This subset is calculated by forwarding `DragSourceListener.dragStart(DragSourceEvent)` to every listener, and inspecting changes to the `doit` field. The `DragSource`'s set of supported Transfer types ( `DragSource.setTransfer(Transfer[])`) is updated to reflect the Transfer types corresponding to the active listener subset.

If and when `DelegatingDragAdapter.dragSetData(DragSourceEvent)` is called, a single `TransferDragSourceListener` is chosen, and only it is allowed to set the drag data. The chosen listener is the first listener in the subset of active listeners whose Transfer supports ( `Transfer.isSupportedType(TransferData)`) the dataType on the `DragSourceEvent`.

## Constructor Summary

Constructors
Constructor
Description
`DelegatingDragAdapter()`

## Method Summary

Modifier and Type
Method
Description
`void`
`addDragSourceListener(TransferDragSourceListener listener)`
Deprecated, for removal: This API element is subject to removal in a future version.
Use `DelegatingDragAdapter.addDragSourceListener(org.eclipse.jface.util.TransferDragSourceListener)` instead.
`Transfer[]`
`getTransferTypes()`
Deprecated, for removal: This API element is subject to removal in a future version.
call getTransfers() instead.
`void`
`removeDragSourceListener(TransferDragSourceListener listener)`
Deprecated, for removal: This API element is subject to removal in a future version.
Use `DelegatingDragAdapter.removeDragSourceListener(org.eclipse.jface.util.TransferDragSourceListener)` instead.

### Methods inherited from class org.eclipse.jface.util.DelegatingDragAdapter

`addDragSourceListener, dragFinished, dragSetData, dragStart, getTransfers, isEmpty, removeDragSourceListener`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### DelegatingDragAdapter

public DelegatingDragAdapter()

## Method Details

### addDragSourceListener

@Deprecated(since="3.0", forRemoval=true) public void addDragSourceListener(TransferDragSourceListener listener)
Deprecated, for removal: This API element is subject to removal in a future version.
Use `DelegatingDragAdapter.addDragSourceListener(org.eclipse.jface.util.TransferDragSourceListener)` instead. This method will be removed after the 2027-03 release.
Adds the given TransferDragSourceListener. The set of Transfer types is updated to reflect the change.

Parameters:
  `listener` - the new listener

### getTransferTypes

@Deprecated(since="3.0", forRemoval=true) public Transfer[] getTransferTypes()
Deprecated, for removal: This API element is subject to removal in a future version.
call getTransfers() instead. This method will be removed after the 2027-03 release.
Combines the `Transfer`s from every TransferDragSourceListener.

Returns:
  the combined `Transfer`s

### removeDragSourceListener

@Deprecated(since="3.0", forRemoval=true) public void removeDragSourceListener(TransferDragSourceListener listener)
Deprecated, for removal: This API element is subject to removal in a future version.
Use `DelegatingDragAdapter.removeDragSourceListener(org.eclipse.jface.util.TransferDragSourceListener)` instead. This method will be removed after the 2027-03 release.
Adds the given TransferDragSourceListener. The set of Transfer types is updated to reflect the change.

Parameters:
  `listener` - the listener being removed