|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.kcl.cch.jb.pliny.dnd.AbstractResourceExtensionProcessor
an abstract class which implements IResourceExtensionProcessor
to
provide a base set of functionality which other can then be extended to support
interactions between Pliny plugins and other plugins. The main features here
are code to support drag-and-drop of objects outside of Eclipse into
Pliny.
Nested Class Summary |
Nested classes inherited from class uk.ac.kcl.cch.jb.pliny.dnd.IResourceExtensionProcessor |
IResourceExtensionProcessor.CacheElement |
Field Summary | |
protected String |
editorId
|
protected org.eclipse.ui.IWorkbenchPage |
myPage
|
protected Vector |
newResources
|
Constructor Summary | |
AbstractResourceExtensionProcessor(org.eclipse.ui.IWorkbenchPage myPage,
String editorId)
|
|
AbstractResourceExtensionProcessor(String editorId)
|
Method Summary | |
abstract boolean |
canHandleObject(Object data)
see IResourceExtensionProcessor.canHandleObject(java.lang.Object)
for details. |
IResourceExtensionProcessor.CacheElement[] |
getCacheElements(Resource r)
override this method to provide support for adding cache data from your plugin into a pliny archive file. |
abstract org.eclipse.draw2d.IFigure |
getContentFigure(Resource resource)
see IResourceExtensionProcessor.getContentFigure(uk.ac.kcl.cch.jb.pliny.model.Resource)
for details. |
protected String |
getFileContentsAsString(InputStream stream)
|
abstract ObjectType |
getMyObjectType()
see IResourceExtensionProcessor.getMyObjectType()
for details. |
IResourceExtensionProcessorSource |
getSource()
returns an IResourceExtensionProcessorSource . |
protected abstract void |
handleFile(String string)
implement this method to handle a file that has been dropped on your processor. |
protected abstract void |
handleResource(Resource resource)
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(String input,
String title)
|
protected abstract boolean |
handleUrl(URL theURL,
String title)
implement this abstract method to provide code to process a dropped object that was a URL. |
protected void |
handleUrlFile(org.eclipse.core.runtime.IPath myPath)
|
abstract Resource |
makeMyResource()
see IResourceExtensionProcessor.makeMyResource()
for details. |
protected void |
makeNote(String input,
String title)
|
protected URL |
makeURLfromFileName(org.eclipse.core.runtime.IPath myPath)
|
void |
openResources()
|
void |
processArchiveEntries(IGetsArchiveEntries archive,
Resource r)
override this method to provide support for creating cache data from Pliny archive files. |
boolean |
processDrop(org.eclipse.swt.dnd.DropTargetEvent event)
this method checks the kind of object being dropped in the Pliny environment and depending upon the kind, invokes various other methods to handle different kinds of data. |
void |
setViewPart(org.eclipse.ui.part.ViewPart myViewPart)
see IResourceExtensionProcessor.setViewPart(org.eclipse.ui.part.ViewPart) . |
protected void |
writeFile(InputStream in,
String outputFileName)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected org.eclipse.ui.IWorkbenchPage myPage
protected Vector newResources
protected String editorId
Constructor Detail |
public AbstractResourceExtensionProcessor(String editorId)
public AbstractResourceExtensionProcessor(org.eclipse.ui.IWorkbenchPage myPage, String editorId)
Method Detail |
public void setViewPart(org.eclipse.ui.part.ViewPart myViewPart)
IResourceExtensionProcessor.setViewPart(org.eclipse.ui.part.ViewPart)
.
The default implementation takes the given ViewPart, fetches its
IWorkbenchPage
, and stores that for object use (to allow editors to be
opened on newly created Resources.
This method may be extended, but this versioni should also be called via
super.setViewPart(...)
in
the code extension.
setViewPart
in interface IResourceExtensionProcessor
myViewPart
- public IResourceExtensionProcessorSource getSource()
IResourceExtensionProcessorSource
. In this default
implementation, this is the same as the associated
ObjectType
.
getSource
in interface IResourceExtensionProcessor
public abstract Resource makeMyResource()
IResourceExtensionProcessor.makeMyResource()
for details.
makeMyResource
in interface IResourceExtensionProcessor
PlinyXMLImporter
public abstract ObjectType getMyObjectType()
IResourceExtensionProcessor.getMyObjectType()
for details.
getMyObjectType
in interface IResourceExtensionProcessor
public abstract boolean canHandleObject(Object data)
IResourceExtensionProcessor.canHandleObject(java.lang.Object)
for details.
canHandleObject
in interface IResourceExtensionProcessor
data
-
true
if this processor can handle this object.public abstract org.eclipse.draw2d.IFigure getContentFigure(Resource resource)
IResourceExtensionProcessor.getContentFigure(uk.ac.kcl.cch.jb.pliny.model.Resource)
for details.
getContentFigure
in interface IResourceExtensionProcessor
resource
- the Resource the IFigure should be about.
public boolean processDrop(org.eclipse.swt.dnd.DropTargetEvent event)
IResourceExtensionProcessor.processDrop(org.eclipse.swt.dnd.DropTargetEvent)
for details.
drop data handled include:
handleResource()
.
handleString()
. The default implementation found
here will take the string and see if it can be interpreted as a URL. If it can,
it will invoke abstract function handleUrl()
.
handleFile()
processDrop
in interface IResourceExtensionProcessor
event
-
protected abstract void handleResource(Resource resource)
resource
- Resource to be introduced.protected abstract void handleFile(String string)
string
- String name of the Filepublic void openResources()
protected void handleUrlFile(org.eclipse.core.runtime.IPath myPath)
protected void handleString(String input)
protected boolean handleUrl(String input, String title)
protected abstract boolean handleUrl(URL theURL, String title)
theURL
- URL the URL the object representstitle
- String a suggested title for the Resource you should create.
true
if the URL was successfully
handled.protected void makeNote(String input, String title)
protected String getFileContentsAsString(InputStream stream)
protected URL makeURLfromFileName(org.eclipse.core.runtime.IPath myPath)
public IResourceExtensionProcessor.CacheElement[] getCacheElements(Resource r)
IResourceExtensionProcessor.getCacheElements(uk.ac.kcl.cch.jb.pliny.model.Resource)
.
getCacheElements
in interface IResourceExtensionProcessor
public void processArchiveEntries(IGetsArchiveEntries archive, Resource r) throws PlinyImportException
IResourceExtensionProcessor.processArchiveEntries(uk.ac.kcl.cch.jb.pliny.dnd.IGetsArchiveEntries, uk.ac.kcl.cch.jb.pliny.model.Resource)
.
processArchiveEntries
in interface IResourceExtensionProcessor
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.r
- Resource the cache data should belong to.
PlinyImportException
protected void writeFile(InputStream in, String outputFileName) throws PlinyImportException
PlinyImportException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |