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

  




 

 

Eclipse GEF
3.3

org.eclipse.gef.dnd
Class TemplateTransferDragSourceListener

java.lang.Object
  extended by

org.eclipse.gef.dnd.AbstractTransferDragSourceListener
      extended by
org.eclipse.gef.dnd.TemplateTransferDragSourceListener
All Implemented Interfaces:
TransferDragSourceListener

public class TemplateTransferDragSourceListener
extends AbstractTransferDragSourceListener

Allows a single PaletteTemplateEntry to be dragged from an EditPartViewer. The PaletteTemplateEntry's template object is the data that is being transfered to the DropTarget.

Since:
2.1

Constructor Summary
TemplateTransferDragSourceListener ( EditPartViewer viewer)
          Constructs a new listener for the specified EditPartViewer.
TemplateTransferDragSourceListener ( EditPartViewer viewer, Transfer xfer)
          Deprecated. Use the constructor without the transfer specified.
 
Method Summary
 void dragFinished (DragSourceEvent event)
           
 void dragSetData (DragSourceEvent event)
          Get the template from the selected PaletteTemplateEntry and sets it as the event data to be dropped.
 void dragStart (DragSourceEvent event)
          Cancels the drag if the selected item does not represent a PaletteTemplateEntry.
protected  java.lang.Object getTemplate ()
          A helper method that returns null or the template Object from the currently selected EditPart.
 
Methods inherited from class org.eclipse.gef.dnd. AbstractTransferDragSourceListener
getTransfer, getViewer, setTransfer, setViewer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemplateTransferDragSourceListener

public TemplateTransferDragSourceListener(
EditPartViewer viewer,
                                          Transfer xfer)
Deprecated. Use the constructor without the transfer specified.

Parameters:
viewer - viewer
xfer - xfer

TemplateTransferDragSourceListener

public TemplateTransferDragSourceListener(
EditPartViewer viewer)
Constructs a new listener for the specified EditPartViewer. The provided Viewer should be one that is displaying a Palette. The TemplateTransferDragSourceListener will only be enabled when a single EditPart is selected, and the EditPart's model is a PaletteTemplateEntry.

Parameters:
viewer - the EditPartViewer that is the drag source
Method Detail

dragFinished

public void dragFinished(DragSourceEvent event)
Overrides:
dragFinished in class AbstractTransferDragSourceListener
See Also:
AbstractTransferDragSourceListener.dragFinished(DragSourceEvent)

dragSetData

public void dragSetData(DragSourceEvent event)
Get the template from the selected PaletteTemplateEntry and sets it as the event data to be dropped.

Parameters:
event - the DragSourceEvent

dragStart

public void dragStart(DragSourceEvent event)
Cancels the drag if the selected item does not represent a PaletteTemplateEntry.

Overrides:
dragStart in class AbstractTransferDragSourceListener
See Also:
org.eclipse.swt.dnd.DragSourceListener#dragStart(DragSourceEvent)

getTemplate

protected java.lang.Object getTemplate()
A helper method that returns null or the template Object from the currently selected EditPart.

Returns:
the template

Eclipse GEF
3.3

Copyright (c) IBM Corp. and others 2000, 2007. All Rights Reserved.

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