|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.dnd.DropTargetAdapter org.eclipse.jface.viewers.ViewerDropAdapter
This adapter class provides generic drag-and-drop support for a viewer.
Subclasses must implement the following methods:
The setFeedbackEnabled method can be called to turn on and off visual insertion feedback (on by default).
Field Summary | |
static int | LOCATION_AFTER
Constant describing the position of the cursor relative to the target object. |
static int | LOCATION_BEFORE
Constant describing the position of the cursor relative to the target object. |
static int | LOCATION_NONE
Constant describing the position of the cursor relative to the target object. |
static int | LOCATION_ON
Constant describing the position of the cursor relative to the target object. |
Constructor Summary | |
protected | ViewerDropAdapter(Viewer viewer)
Creates a new drop adapter for the given viewer. |
Method Summary | |
protected int | determineLocation(DropTargetEvent event)
Returns the position of the given event's coordinates relative to its target. |
protected Object | determineTarget(DropTargetEvent event)
Returns the target item of the given drop event. |
void | dragEnter(DropTargetEvent event)
This implementation of dragEnter permits the default operation defined in event.detailto be performed on the current data type defined in event.currentDataType. |
void | dragOperationChanged(DropTargetEvent event)
This implementation of dragOperationChanged permits the default operation defined in event.detailto be performed on the current data type defined in event.currentDataType. |
void | dragOver(DropTargetEvent event)
This implementation of dragOver permits the default operation defined in event.detailto be performed on the current data type defined in event.currentDataType. |
void | drop(DropTargetEvent event)
This implementation of drop does nothing. |
void | dropAccept(DropTargetEvent event)
This implementation of dropAccept permits the default operation defined in event.detailto be performed on the current data type defined in event.currentDataType. |
protected Rectangle | getBounds(Item item)
Returns the bounds of the given SWT tree or table item. |
protected int | getCurrentLocation()
Returns a constant describing the position of the mouse relative to the target (before, on, or after the target. |
protected int | getCurrentOperation()
Returns the current operation. |
protected Object | getCurrentTarget()
Returns the target object currently under the mouse. |
boolean | getFeedbackEnabled()
Returns whether visible insertion feedback should be presented to the user. |
protected Object | getSelectedObject()
Returns the object currently selected by the viewer. |
protected Viewer | getViewer()
Returns the viewer to which this drop support has been added. |
protected void | handleException(Throwable exception,
DropTargetEvent event)
Deprecated. this method should not be used. Exception handling has been removed from DropTargetAdapter methods overridden by this class. Handles any exception that occurs during callback, including rethrowing behavior. [Issue: Implementation prints stack trace and eats exception to avoid crashing VA/J. Consider conditionalizing the implementation to do one thing in VAJ and something more reasonable in other operating environments. ] |
abstract boolean | performDrop(Object data)
Performs any work associated with the drop. |
void | setFeedbackEnabled(boolean value)
Sets whether visible insertion feedback should be presented to the user. |
void | setScrollExpandEnabled(boolean value)
Sets whether auto scrolling and expanding should be provided during dragging. |
abstract boolean | validateDrop(Object target,
int operation,
TransferData transferType)
Validates dropping on the given object. |
Methods inherited from class org.eclipse.swt.dnd.DropTargetAdapter |
dragLeave |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int LOCATION_BEFORE
public static final int LOCATION_AFTER
public static final int LOCATION_ON
public static final int LOCATION_NONE
Constructor Detail |
protected ViewerDropAdapter(Viewer viewer)
Method Detail |
protected int determineLocation(DropTargetEvent event)
protected Object determineTarget(DropTargetEvent event)
public void dragEnter(DropTargetEvent event)
public void dragOperationChanged(DropTargetEvent event)
public void dragOver(DropTargetEvent event)
public void drop(DropTargetEvent event)
public void dropAccept(DropTargetEvent event)
protected Rectangle getBounds(Item item)
protected int getCurrentLocation()
protected int getCurrentOperation()
protected Object getCurrentTarget()
public boolean getFeedbackEnabled()
Typical insertion feedback is the horizontal insertion bars that appear between adjacent items while dragging.
protected Object getSelectedObject()
protected Viewer getViewer()
protected void handleException(Throwable exception, DropTargetEvent event)
[Issue: Implementation prints stack trace and eats exception to avoid crashing VA/J. Consider conditionalizing the implementation to do one thing in VAJ and something more reasonable in other operating environments. ]
public abstract boolean performDrop(Object data)
Subclasses must implement this method to provide drop behavior.
public void setFeedbackEnabled(boolean value)
Typical insertion feedback is the horizontal insertion bars that appear between adjacent items while dragging.
public void setScrollExpandEnabled(boolean value)
public abstract boolean validateDrop(Object target, int operation, TransferData transferType)
Subclasses must implement this method to define which drops make sense.
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.