uk.ac.kcl.cch.jb.pliny.dnd
Class DnDResourceHolder

java.lang.Object
  extended byuk.ac.kcl.cch.jb.pliny.dnd.DnDResourceHolder
All Implemented Interfaces:
org.eclipse.swt.dnd.DragSourceListener, EventListener, org.eclipse.swt.internal.SWTEventListener

public class DnDResourceHolder
extends Object
implements org.eclipse.swt.dnd.DragSourceListener

this class wraps the function of an image Icon and a draggable object together for resources. It creates an image for an icon and is given a Resource which it holds. The image is setup as draggable, and if dropped elsewhere in a Pliny application will have a Pliny Resource to deliver as its content.

Note: This object supports DnD between Pliny components within a single Eclipse instance only.

Author:
John Bradley

Constructor Summary
DnDResourceHolder(org.eclipse.swt.widgets.Composite parent, int style)
          create the DnDResource Holder, and create the Icon that will represent it.
 
Method Summary
 void dragFinished(org.eclipse.swt.dnd.DragSourceEvent event)
           
 void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event)
           
 void dragStart(org.eclipse.swt.dnd.DragSourceEvent event)
           
 org.eclipse.swt.widgets.Label getLabel()
           
 Resource getResource()
           
 void setResource(Resource resource)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DnDResourceHolder

public DnDResourceHolder(org.eclipse.swt.widgets.Composite parent,
                         int style)
create the DnDResource Holder, and create the Icon that will represent it.

Parameters:
parent - Composite to act as parent to the icon
style - int SWT style values for the icon
Method Detail

getLabel

public org.eclipse.swt.widgets.Label getLabel()

getResource

public Resource getResource()

setResource

public void setResource(Resource resource)

dragStart

public void dragStart(org.eclipse.swt.dnd.DragSourceEvent event)
Specified by:
dragStart in interface org.eclipse.swt.dnd.DragSourceListener

dragSetData

public void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event)
Specified by:
dragSetData in interface org.eclipse.swt.dnd.DragSourceListener

dragFinished

public void dragFinished(org.eclipse.swt.dnd.DragSourceEvent event)
Specified by:
dragFinished in interface org.eclipse.swt.dnd.DragSourceListener