public class LinuxDropTarget
extends org.eclipse.swt.dnd.DropTarget
implements org.eclipse.swt.dnd.DropTargetListener
This class can be used instead of DropTraget on Linux platform, when a parent Control eats all drag&drop events instead of the wanted widget.
The constructor must be used with the control that eats drag events (a tab folder for example).
The addDropListener method must then be called with the real widget on which element should be dropped, and the corresponding DropTargetListener.
The real widget should of course belong to the first control.
Constructor and Description |
---|
LinuxDropTarget(org.eclipse.swt.widgets.Control parentControl,
int style)
Creates a drop target.
|
Modifier and Type | Method and Description |
---|---|
void |
addDropListener(org.eclipse.swt.widgets.Control delegationControl,
org.eclipse.swt.dnd.DropTargetListener delegationListener)
Add a listener to be called during drag&drop on the specified control.
|
protected void |
checkSubclass() |
void |
dragEnter(org.eclipse.swt.dnd.DropTargetEvent event) |
void |
dragLeave(org.eclipse.swt.dnd.DropTargetEvent event) |
void |
dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event) |
void |
dragOver(org.eclipse.swt.dnd.DropTargetEvent event) |
void |
drop(org.eclipse.swt.dnd.DropTargetEvent event) |
void |
dropAccept(org.eclipse.swt.dnd.DropTargetEvent event) |
addDropListener, getControl, getDropListeners, getDropTargetEffect, getTransfer, removeDropListener, setDropTargetEffect, setTransfer
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
public LinuxDropTarget(org.eclipse.swt.widgets.Control parentControl, int style)
parentControl
- The control that eats drag events.style
- the bitwise OR'ing of allowed operations; this may be a combination of any of DND.DROP_NONE, DND.DROP_COPY, DND.DROP_MOVE, DND.DROP_LINKpublic void addDropListener(org.eclipse.swt.widgets.Control delegationControl, org.eclipse.swt.dnd.DropTargetListener delegationListener)
delegationControl
- The real control on which dragged element should be dropped. delegationListener
- The listener to add.public void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
dragEnter
in interface org.eclipse.swt.dnd.DropTargetListener
public void dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
dragLeave
in interface org.eclipse.swt.dnd.DropTargetListener
public void dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent event)
dragOperationChanged
in interface org.eclipse.swt.dnd.DropTargetListener
public void dragOver(org.eclipse.swt.dnd.DropTargetEvent event)
dragOver
in interface org.eclipse.swt.dnd.DropTargetListener
public void drop(org.eclipse.swt.dnd.DropTargetEvent event)
drop
in interface org.eclipse.swt.dnd.DropTargetListener
public void dropAccept(org.eclipse.swt.dnd.DropTargetEvent event)
dropAccept
in interface org.eclipse.swt.dnd.DropTargetListener
protected void checkSubclass()
checkSubclass
in class org.eclipse.swt.dnd.DropTarget