|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.common.ui.services.dnd.drop.DropTargetContext
public class DropTargetContext
Concrete implementation of IDropTargetContext
Field Summary | |
---|---|
protected Point |
location
Attribute for the current location. |
protected static int |
LOCATION_EPSILON
The threshold used to determine if the mouse is before or after a target item. |
protected int |
relativeLocation
Attribute for the relative location. |
protected java.lang.Object |
target
Attribute for the target. |
Fields inherited from interface org.eclipse.gmf.runtime.common.ui.services.dnd.drop.IDropTargetContext |
---|
LOCATION_AFTER, LOCATION_BEFORE, LOCATION_NONE, LOCATION_ON |
Constructor Summary | |
---|---|
DropTargetContext(IWorkbenchPart anActivePart,
Control aViewerControl)
Constructor for DropTargetContext. |
Method Summary | |
---|---|
protected void |
dragEnter(DropTargetEvent event)
Set details of the event upon entering the drop target |
protected void |
dragLeave(DropTargetEvent event)
Called when leaving the drop target or cancelling |
protected void |
dragOperationChanged(DropTargetEvent event)
Called when the drag operation has changed |
protected void |
dragOver(DropTargetEvent event)
Called when over the drop target |
protected void |
drop(DropTargetEvent event)
Called upon a drop |
protected void |
dropAccept(DropTargetEvent event)
Called immediately before a drop |
IWorkbenchPart |
getActivePart()
Returns the active IWorkbenchPart associated with the drop
target viewer. |
Point |
getCurrentLocation()
Returns the coordinates of the current location of the mouse. |
java.lang.Object |
getCurrentTarget()
Returns the current target on the drop target viewer |
int |
getRelativeLocation()
Constant describing the position of the cursor relative to the target object |
Control |
getViewerControl()
Returns the control associated with the drop target viewer. |
protected void |
setCurrentTargetAndLocation(DropTargetEvent event)
Sets the target item of the given drop event as the current target. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int LOCATION_EPSILON
protected java.lang.Object target
protected Point location
protected int relativeLocation
Constructor Detail |
---|
public DropTargetContext(IWorkbenchPart anActivePart, Control aViewerControl)
anActivePart
- the active IWorkbenchPartaViewerControl
- Control of the drop targetMethod Detail |
---|
public final IWorkbenchPart getActivePart()
IDropTargetContext
IWorkbenchPart
associated with the drop
target viewer.
getActivePart
in interface IDropTargetContext
IWorkbenchPart
public final java.lang.Object getCurrentTarget()
IDropTargetContext
getCurrentTarget
in interface IDropTargetContext
public final Point getCurrentLocation()
IDropTargetContext
getCurrentLocation
in interface IDropTargetContext
public final Control getViewerControl()
IDropTargetContext
getViewerControl
in interface IDropTargetContext
protected void setCurrentTargetAndLocation(DropTargetEvent event)
event
- the eventprotected void dragEnter(DropTargetEvent event)
event
- DropTargetEvent to have its detail field resetDropTargetListener.dragEnter(org.eclipse.swt.dnd.DropTargetEvent)
protected void dragOperationChanged(DropTargetEvent event)
event
- DropTargetEvent to updateDropTargetListener.dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)
protected void dragOver(DropTargetEvent event)
event
- DropTargetEvent to updateDropTargetListener.dragOver(org.eclipse.swt.dnd.DropTargetEvent)
protected void drop(DropTargetEvent event)
event
- DropTargetEvent to updateDropTargetListener.drop(org.eclipse.swt.dnd.DropTargetEvent)
protected void dropAccept(DropTargetEvent event)
event
- DropTargetEvent to have its detail field resetDropTargetListener.dropAccept(org.eclipse.swt.dnd.DropTargetEvent)
protected void dragLeave(DropTargetEvent event)
event
- DropTargetEvent to updateDropTargetListener.dragLeave(org.eclipse.swt.dnd.DropTargetEvent)
public final int getRelativeLocation()
IDropTargetContext
getRelativeLocation
in interface IDropTargetContext
|
Runtime | |||||||||
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., Borland Software Corp., and others 2005,2006. All rights reserved.