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

java.lang.Object
  extended byuk.ac.kcl.cch.jb.pliny.dnd.ClipboardHandler

public class ClipboardHandler
extends Object

This class is a singleton class that handles Pliny-oriented cut, copy and paste operations related to the Clipboard via Text transfer and GEF's internal-to-Eclipse copy and paste SimpleObjectTransfer.

Author:
John Bradley

Field Summary
static org.eclipse.gef.dnd.SimpleObjectTransfer TRANSFER
           
 
Method Summary
 Collection getContents()
          invoke this method on paste operations to generate Pliny-oriented materials from the contents of clipboard.
static ClipboardHandler getDefault()
          invoke this method to get access to the singleton instance of this class.
 Vector processTextObject(Object object)
          processes various kind of text-related objects that can be generated by cut/copy/paste or drag-and-drop operations to produce a NoteLucened
 void setContents(Object contents)
          invoke this method on copy or cut operations to send Pliny-oriented materials to the clipboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSFER

public static final org.eclipse.gef.dnd.SimpleObjectTransfer TRANSFER
Method Detail

getDefault

public static ClipboardHandler getDefault()
invoke this method to get access to the singleton instance of this class.

Returns:
ClipboardHandler the handler.

setContents

public void setContents(Object contents)
invoke this method on copy or cut operations to send Pliny-oriented materials to the clipboard. This code knows how to handle Pliny NoteLucened, Resource (more generally), LinkableObject, and selections of text, and Collections of these objects.

Parameters:
contents - Object to be sent to the clipboard

getContents

public Collection getContents()
invoke this method on paste operations to generate Pliny-oriented materials from the contents of clipboard. This code knows how to handle Pliny NoteLucened, Resource (more generally), LinkableObject, and selections of text, Files, and Collections of these objects.

Files are handled by looking up the kind of Eclipse editor that can handle the particular file type, and then producing a Pliny resource that refers to the file and its editor.

Returns:
Collection containing materials transformed into Pliny objects.

processTextObject

public Vector processTextObject(Object object)
processes various kind of text-related objects that can be generated by cut/copy/paste or drag-and-drop operations to produce a NoteLucened

Parameters:
object - Object provided by cut/copy/paste or drag-drop
Returns:
Vector of Notes created from materials provided.