|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.ui.dnd.CDTViewerDropAdapter
public class CDTViewerDropAdapter
A drag and drop adapter to be used together with structured viewers.
The adapater delegates the dragEnter
, dragOperationChanged
, dragOver
and dropAccept
method to the
validateDrop
method. Furthermore it adds location feedback.
Field Summary | |
---|---|
static int |
INSERTION_FEEDBACK
Style to enable location feedback. |
static int |
LOCATION_AFTER
Constant describing the position of the mouse cursor relative to the target object. |
static int |
LOCATION_BEFORE
Constant describing the position of the mouse cursor relative to the target object. |
static int |
LOCATION_NONE
Constant describing the position of the mouse cursor relative to the target object. |
static int |
LOCATION_ON
Constant describing the position of the mouse cursor relative to the target object. |
Constructor Summary | |
---|---|
CDTViewerDropAdapter(org.eclipse.jface.viewers.StructuredViewer viewer,
int feedback)
|
Method Summary | |
---|---|
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)
The actual drop has occurred. |
void |
drop(java.lang.Object target,
org.eclipse.swt.dnd.DropTargetEvent event)
The actual drop has occurred. |
void |
dropAccept(org.eclipse.swt.dnd.DropTargetEvent event)
|
void |
internalTestSetLocation(int location)
|
void |
showInsertionFeedback(boolean showInsertionFeedback)
Controls whether the drop adapter shows insertion feedback or not. |
void |
validateDrop(org.eclipse.swt.dnd.DropTargetEvent event)
Checks if the drop is valid. |
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 |
Field Detail |
---|
public static final int LOCATION_NONE
public static final int LOCATION_ON
public static final int LOCATION_BEFORE
public static final int LOCATION_AFTER
public static final int INSERTION_FEEDBACK
Constructor Detail |
---|
public CDTViewerDropAdapter(org.eclipse.jface.viewers.StructuredViewer viewer, int feedback)
Method Detail |
---|
public void showInsertionFeedback(boolean showInsertionFeedback)
showInsertionFeedback
- true
if the drop adapter is supposed
to show insertion feedback. Otherwise false
public void drop(org.eclipse.swt.dnd.DropTargetEvent event)
drop(Object target, DropTargetEvent event)
.
drop
in interface org.eclipse.swt.dnd.DropTargetListener
DropTargetListener.drop(org.eclipse.swt.dnd.DropTargetEvent)
public void drop(java.lang.Object target, org.eclipse.swt.dnd.DropTargetEvent event)
target
- the drop target in form of a domain element.event
- the drop traget eventpublic void validateDrop(org.eclipse.swt.dnd.DropTargetEvent event)
validateDrop
(Object target, DropTargetEvent event). Implementors can alter the
currentDataType
field and the detail
field
to give feedback about drop acceptence.
public void validateDrop(java.lang.Object target, org.eclipse.swt.dnd.DropTargetEvent event, int operation)
currentDataType
field and the
detail
field to give feedback about drop acceptence.
target
- the drop target in form of a domain element.event
- the drop traget eventoperation
- the operation requested by the user.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 dropAccept(org.eclipse.swt.dnd.DropTargetEvent event)
dropAccept
in interface org.eclipse.swt.dnd.DropTargetListener
public void internalTestSetLocation(int location)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |