org.eclipse.cdt.internal.ui.cview
Class SelectionTransferDropAdapter
java.lang.Object
org.eclipse.cdt.internal.ui.dnd.CDTViewerDropAdapter
org.eclipse.cdt.internal.ui.cview.SelectionTransferDropAdapter
- All Implemented Interfaces:
- java.util.EventListener, TransferDropTargetListener, org.eclipse.swt.dnd.DropTargetListener, org.eclipse.swt.internal.SWTEventListener
public class SelectionTransferDropAdapter
- extends CDTViewerDropAdapter
- implements TransferDropTargetListener
Method Summary |
void |
dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
|
void |
dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
|
void |
drop(java.lang.Object target,
org.eclipse.swt.dnd.DropTargetEvent event)
The actual drop has occurred. |
static org.eclipse.cdt.core.model.ICElement[] |
getCElements(java.util.List elements)
|
org.eclipse.swt.dnd.Transfer |
getTransfer()
Returns the transfer used by this drop target. |
boolean |
isEnabled(org.eclipse.swt.dnd.DropTargetEvent event)
Returns whether the listener is able to handle the given
drop traget event. |
void |
run(org.eclipse.jface.operation.IRunnableWithProgress runnable)
|
void |
validateDrop(java.lang.Object target,
org.eclipse.swt.dnd.DropTargetEvent event,
int operation)
Checks if the drop on the current target is valid. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.swt.dnd.DropTargetListener |
dragOperationChanged, dragOver, drop, dropAccept |
SelectionTransferDropAdapter
public SelectionTransferDropAdapter(org.eclipse.jface.viewers.StructuredViewer viewer)
getTransfer
public org.eclipse.swt.dnd.Transfer getTransfer()
- Description copied from interface:
TransferDropTargetListener
- Returns the transfer used by this drop target.
- Specified by:
getTransfer
in interface TransferDropTargetListener
isEnabled
public boolean isEnabled(org.eclipse.swt.dnd.DropTargetEvent event)
- Description copied from interface:
TransferDropTargetListener
- Returns whether the listener is able to handle the given
drop traget event.
- Specified by:
isEnabled
in interface TransferDropTargetListener
- Parameters:
event
- the drop target event
- Returns:
true
if the listener can handle the event;
otherwise false
dragEnter
public void dragEnter(org.eclipse.swt.dnd.DropTargetEvent event)
- Specified by:
dragEnter
in interface org.eclipse.swt.dnd.DropTargetListener
- Overrides:
dragEnter
in class CDTViewerDropAdapter
dragLeave
public void dragLeave(org.eclipse.swt.dnd.DropTargetEvent event)
- Specified by:
dragLeave
in interface org.eclipse.swt.dnd.DropTargetListener
- Overrides:
dragLeave
in class CDTViewerDropAdapter
validateDrop
public void validateDrop(java.lang.Object target,
org.eclipse.swt.dnd.DropTargetEvent event,
int operation)
- Description copied from class:
CDTViewerDropAdapter
- Checks if the drop on the current target is valid. The method
can alter the
currentDataType
field and the
detail
field to give feedback about drop acceptence.
- Overrides:
validateDrop
in class CDTViewerDropAdapter
- Parameters:
target
- the drop target in form of a domain element.event
- the drop traget eventoperation
- the operation requested by the user.
drop
public void drop(java.lang.Object target,
org.eclipse.swt.dnd.DropTargetEvent event)
- Description copied from class:
CDTViewerDropAdapter
- The actual drop has occurred.
- Overrides:
drop
in class CDTViewerDropAdapter
- Parameters:
target
- the drop target in form of a domain element.event
- the drop traget event
run
public void run(org.eclipse.jface.operation.IRunnableWithProgress runnable)
throws java.lang.InterruptedException,
java.lang.reflect.InvocationTargetException
- Throws:
java.lang.InterruptedException
java.lang.reflect.InvocationTargetException
getCElements
public static org.eclipse.cdt.core.model.ICElement[] getCElements(java.util.List elements)