Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Runtime

org.eclipse.gmf.runtime.common.ui.services.dnd.drop
Class DropTargetContext

java.lang.Object
  extended by 
org.eclipse.gmf.runtime.common.ui.services.dnd.drop.DropTargetContext
All Implemented Interfaces:
IDropTargetContext

public class DropTargetContext
extends java.lang.Object
implements IDropTargetContext

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

LOCATION_EPSILON

protected static final int LOCATION_EPSILON
The threshold used to determine if the mouse is before or after a target item.

See Also:
Constant Field Values

target

protected java.lang.Object target
Attribute for the target.


location

protected 
Point location
Attribute for the current location.


relativeLocation

protected int relativeLocation
Attribute for the relative location.

Constructor Detail

DropTargetContext

public DropTargetContext(
IWorkbenchPart anActivePart,
                         
Control aViewerControl)
Constructor for DropTargetContext.

Parameters:
anActivePart - the active IWorkbenchPart
aViewerControl - Control of the drop target
Method Detail

getActivePart

public final 
IWorkbenchPart getActivePart()
Description copied from interface: IDropTargetContext
Returns the active IWorkbenchPart associated with the drop target viewer.

Specified by:
getActivePart in interface IDropTargetContext
Returns:
Returns the active IWorkbenchPart

getCurrentTarget

public final java.lang.Object getCurrentTarget()
Description copied from interface: IDropTargetContext
Returns the current target on the drop target viewer

Specified by:
getCurrentTarget in interface IDropTargetContext
Returns:
Returns the current target on the drop target viewer

getCurrentLocation

public final 
Point getCurrentLocation()
Description copied from interface: IDropTargetContext
Returns the coordinates of the current location of the mouse.

Specified by:
getCurrentLocation in interface IDropTargetContext
Returns:
Point the location

getViewerControl

public final 
Control getViewerControl()
Description copied from interface: IDropTargetContext
Returns the control associated with the drop target viewer.

Specified by:
getViewerControl in interface IDropTargetContext
Returns:
Control

setCurrentTargetAndLocation

protected void setCurrentTargetAndLocation(
DropTargetEvent event)
Sets the target item of the given drop event as the current target. Also sets the current coordinates of the current location of the mouse.

Parameters:
event - the event

dragEnter

protected void dragEnter(
DropTargetEvent event)
Set details of the event upon entering the drop target

Parameters:
event - DropTargetEvent to have its detail field reset
See Also:
DropTargetListener.dragEnter(org.eclipse.swt.dnd.DropTargetEvent)

dragOperationChanged

protected void dragOperationChanged(
DropTargetEvent event)
Called when the drag operation has changed

Parameters:
event - DropTargetEvent to update
See Also:
DropTargetListener.dragOperationChanged(org.eclipse.swt.dnd.DropTargetEvent)

dragOver

protected void dragOver(
DropTargetEvent event)
Called when over the drop target

Parameters:
event - DropTargetEvent to update
See Also:
DropTargetListener.dragOver(org.eclipse.swt.dnd.DropTargetEvent)

drop

protected void drop(
DropTargetEvent event)
Called upon a drop

Parameters:
event - DropTargetEvent to update
See Also:
DropTargetListener.drop(org.eclipse.swt.dnd.DropTargetEvent)

dropAccept

protected void dropAccept(
DropTargetEvent event)
Called immediately before a drop

Parameters:
event - DropTargetEvent to have its detail field reset
See Also:
DropTargetListener.dropAccept(org.eclipse.swt.dnd.DropTargetEvent)

dragLeave

protected void dragLeave(
DropTargetEvent event)
Called when leaving the drop target or cancelling

Parameters:
event - DropTargetEvent to update
See Also:
DropTargetListener.dragLeave(org.eclipse.swt.dnd.DropTargetEvent)

getRelativeLocation

public final int getRelativeLocation()
Description copied from interface: IDropTargetContext
Constant describing the position of the cursor relative to the target object

Specified by:
getRelativeLocation in interface IDropTargetContext
Returns:
int the location

Runtime

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire