uk.ac.kcl.cch.jb.pliny.imageRes.dnd
Class ImageEditorResourceExtensionProcessor

java.lang.Object
  extended byuk.ac.kcl.cch.jb.pliny.dnd.AbstractResourceExtensionProcessor
      extended byuk.ac.kcl.cch.jb.pliny.imageRes.dnd.ImageEditorResourceExtensionProcessor
All Implemented Interfaces:
IResourceExtensionProcessor

public class ImageEditorResourceExtensionProcessor
extends AbstractResourceExtensionProcessor

the ResourceExtensionProcessor for Image Resources.

Author:
John Bradley
See Also:
AbstractResourceExtensionProcessor

Nested Class Summary
 
Nested classes inherited from class uk.ac.kcl.cch.jb.pliny.dnd.IResourceExtensionProcessor
IResourceExtensionProcessor.CacheElement
 
Field Summary
 
Fields inherited from class uk.ac.kcl.cch.jb.pliny.dnd.AbstractResourceExtensionProcessor
editorId, myPage, newResources
 
Constructor Summary
ImageEditorResourceExtensionProcessor()
           
ImageEditorResourceExtensionProcessor(org.eclipse.ui.IWorkbenchPage thePage)
           
 
Method Summary
 boolean canHandleObject(Object data)
          see IResourceExtensionProcessor.canHandleObject(java.lang.Object) for details.
 IResourceExtensionProcessor.CacheElement[] getCacheElements(Resource resource)
          override this method to provide support for adding cache data from your plugin into a pliny archive file.
 org.eclipse.draw2d.IFigure getContentFigure(Resource resource)
          see IResourceExtensionProcessor.getContentFigure(uk.ac.kcl.cch.jb.pliny.model.Resource) for details.
 ObjectType getMyObjectType()
          see IResourceExtensionProcessor.getMyObjectType() for details.
 Vector getTheNewImages()
           
protected  void handleFile(String name)
          implement this method to handle a file that has been dropped on your processor.
protected  void handleResource(Resource myResource)
          implementment this method to process a Resource that has been dragged into this process from another Pliny application.
protected  void handleString(String input)
           
protected  boolean handleUrl(URL theURL, String title)
          implement this abstract method to provide code to process a dropped object that was a URL.
 Resource makeMyResource()
          see IResourceExtensionProcessor.makeMyResource() for details.
 void processArchiveEntries(IGetsArchiveEntries archive, Resource resource)
          override this method to provide support for creating cache data from Pliny archive files.
 void processUrl(URL theURL, String title)
           
 
Methods inherited from class uk.ac.kcl.cch.jb.pliny.dnd.AbstractResourceExtensionProcessor
getFileContentsAsString, getSource, handleUrl, handleUrlFile, makeNote, makeURLfromFileName, openResources, processDrop, setViewPart, writeFile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageEditorResourceExtensionProcessor

public ImageEditorResourceExtensionProcessor()

ImageEditorResourceExtensionProcessor

public ImageEditorResourceExtensionProcessor(org.eclipse.ui.IWorkbenchPage thePage)
Method Detail

processUrl

public void processUrl(URL theURL,
                       String title)

getTheNewImages

public Vector getTheNewImages()

handleUrl

protected boolean handleUrl(URL theURL,
                            String title)
Description copied from class: AbstractResourceExtensionProcessor
implement this abstract method to provide code to process a dropped object that was a URL.

Specified by:
handleUrl in class AbstractResourceExtensionProcessor
Parameters:
theURL - URL the URL the object represents
title - String a suggested title for the Resource you should create.
Returns:
boolean return true if the URL was successfully handled.

handleString

protected void handleString(String input)
Overrides:
handleString in class AbstractResourceExtensionProcessor

handleFile

protected void handleFile(String name)
Description copied from class: AbstractResourceExtensionProcessor
implement this method to handle a file that has been dropped on your processor.

Specified by:
handleFile in class AbstractResourceExtensionProcessor
Parameters:
name - String name of the File

handleResource

protected void handleResource(Resource myResource)
Description copied from class: AbstractResourceExtensionProcessor
implementment this method to process a Resource that has been dragged into this process from another Pliny application.

Specified by:
handleResource in class AbstractResourceExtensionProcessor
Parameters:
myResource - Resource to be introduced.

makeMyResource

public Resource makeMyResource()
Description copied from class: AbstractResourceExtensionProcessor
see IResourceExtensionProcessor.makeMyResource() for details.

Specified by:
makeMyResource in interface IResourceExtensionProcessor
Specified by:
makeMyResource in class AbstractResourceExtensionProcessor
Returns:
Resource a new Resource of suitable type not yet set up in the backing store.

getMyObjectType

public ObjectType getMyObjectType()
Description copied from class: AbstractResourceExtensionProcessor
see IResourceExtensionProcessor.getMyObjectType() for details.

Specified by:
getMyObjectType in interface IResourceExtensionProcessor
Specified by:
getMyObjectType in class AbstractResourceExtensionProcessor
Returns:
ObjectType the type of resource created by this processor.

canHandleObject

public boolean canHandleObject(Object data)
Description copied from class: AbstractResourceExtensionProcessor
see IResourceExtensionProcessor.canHandleObject(java.lang.Object) for details.

Specified by:
canHandleObject in interface IResourceExtensionProcessor
Specified by:
canHandleObject in class AbstractResourceExtensionProcessor
Returns:
boolean returns true if this processor can handle this object.

getContentFigure

public org.eclipse.draw2d.IFigure getContentFigure(Resource resource)
Description copied from class: AbstractResourceExtensionProcessor
see IResourceExtensionProcessor.getContentFigure(uk.ac.kcl.cch.jb.pliny.model.Resource) for details.

Specified by:
getContentFigure in interface IResourceExtensionProcessor
Specified by:
getContentFigure in class AbstractResourceExtensionProcessor
Returns:
IFigure the figure to display.

getCacheElements

public IResourceExtensionProcessor.CacheElement[] getCacheElements(Resource resource)
Description copied from class: AbstractResourceExtensionProcessor
override this method to provide support for adding cache data from your plugin into a pliny archive file. See IResourceExtensionProcessor.getCacheElements(uk.ac.kcl.cch.jb.pliny.model.Resource).

Specified by:
getCacheElements in interface IResourceExtensionProcessor
Overrides:
getCacheElements in class AbstractResourceExtensionProcessor
Returns:
an array of CacheElements that the the archiver what data is to be put in the archive file, and give a handle to a Stream that can provide it.

processArchiveEntries

public void processArchiveEntries(IGetsArchiveEntries archive,
                                  Resource resource)
                           throws PlinyImportException
Description copied from class: AbstractResourceExtensionProcessor
override this method to provide support for creating cache data from Pliny archive files. See IResourceExtensionProcessor.processArchiveEntries(uk.ac.kcl.cch.jb.pliny.dnd.IGetsArchiveEntries, uk.ac.kcl.cch.jb.pliny.model.Resource).

Specified by:
processArchiveEntries in interface IResourceExtensionProcessor
Overrides:
processArchiveEntries in class AbstractResourceExtensionProcessor
Parameters:
archive - IGetsArchiveEntries archive process that can provide you with access to input streams from the archive containing the data you want to put in the cache.
resource - Resource the cache data should belong to.
Throws:
PlinyImportException