uk.ac.kcl.cch.jb.pliny.imageRes
Class ImageEditor

java.lang.Object
  extended byorg.eclipse.core.commands.common.EventManager
      extended byorg.eclipse.ui.part.WorkbenchPart
          extended byorg.eclipse.ui.part.EditorPart
              extended byorg.eclipse.gef.ui.parts.GraphicalEditor
                  extended byuk.ac.kcl.cch.jb.pliny.imageRes.ImageEditor
All Implemented Interfaces:
org.eclipse.gef.commands.CommandStackListener, EventListener, org.eclipse.core.runtime.IAdaptable, org.eclipse.ui.IEditorPart, org.eclipse.core.runtime.IExecutableExtension, IHandlesAnnotations, IResourceDrivenPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.ISelectionListener, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation, IZoomableImageEditor, PropertyChangeListener

public class ImageEditor
extends org.eclipse.gef.ui.parts.GraphicalEditor
implements PropertyChangeListener, IResourceDrivenPart, IHandlesAnnotations, IZoomableImageEditor

an EditorPart that implements the Pliny Image Resource Editor.

Note that the input the Image Editor is to work on is specified by a ResourceEditorInput instance.

Author:
John Bradley

Field Summary
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Constructor Summary
ImageEditor()
           
 
Method Summary
protected  void createActions()
           
 void dispose()
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
 org.eclipse.gef.commands.CommandStack getCommandStack()
          changes in the zoom size are meant to be undoable, so they are managed in the GEF manner by a CommandStack owned by the editor, and must be made accessible to the control.
protected  org.eclipse.gef.EditPartFactory getEditPartFactory()
           
 org.eclipse.gef.EditDomain getMyEditDomain()
           
 org.eclipse.gef.GraphicalViewer getMyGraphicViewer()
           
 IZoomableImageResource getMyImageResource()
          return the Pliny Resource that this editor is currently working with.
 Resource getMyResource()
          returns the Resource that this part is currently using as its input.
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
           
protected  void initializeGraphicalViewer()
           
 boolean isSaveAsAllowed()
           
 boolean isSaveOnCloseNeeded()
           
 void propertyChange(PropertyChangeEvent arg0)
           
protected  void setInput(org.eclipse.ui.IEditorInput input)
           
 
Methods inherited from class org.eclipse.gef.ui.parts.GraphicalEditor
commandStackChanged, configureGraphicalViewer, createGraphicalViewer, createPartControl, firePropertyChange, getActionRegistry, getAdapter, getEditDomain, getGraphicalViewer, getPropertyActions, getSelectionActions, getSelectionSynchronizer, getStackActions, hookGraphicalViewer, initializeActionRegistry, isDirty, selectionChanged, setActionRegistry, setEditDomain, setFocus, setGraphicalViewer, updateActions
 
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, setContentDescription, setInitializationData, setInputWithNotify, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, setSite, setTitle, setTitleImage, setTitleToolTip, showBusy
 
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, createPartControl, getSite, getTitle, getTitleImage, getTitleToolTip, removePropertyListener, setFocus
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

ImageEditor

public ImageEditor()
Method Detail

getMyEditDomain

public org.eclipse.gef.EditDomain getMyEditDomain()

getMyImageResource

public IZoomableImageResource getMyImageResource()
Description copied from interface: IZoomableImageEditor
return the Pliny Resource that this editor is currently working with. The resource must implement the IZoomableImageResource interace

Specified by:
getMyImageResource in interface IZoomableImageEditor
Returns:
IZoomableImageResource the editor's current resource.

getMyResource

public Resource getMyResource()
Description copied from interface: IResourceDrivenPart
returns the Resource that this part is currently using as its input.

Specified by:
getMyResource in interface IResourceDrivenPart
Returns:
Resource

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput input)
          throws org.eclipse.ui.PartInitException
Specified by:
init in interface org.eclipse.ui.IEditorPart
Throws:
org.eclipse.ui.PartInitException

setInput

protected void setInput(org.eclipse.ui.IEditorInput input)

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart

createActions

protected void createActions()

getCommandStack

public org.eclipse.gef.commands.CommandStack getCommandStack()
Description copied from interface: IZoomableImageEditor
changes in the zoom size are meant to be undoable, so they are managed in the GEF manner by a CommandStack owned by the editor, and must be made accessible to the control.

Specified by:
getCommandStack in interface IZoomableImageEditor

getEditPartFactory

protected org.eclipse.gef.EditPartFactory getEditPartFactory()

initializeGraphicalViewer

protected void initializeGraphicalViewer()

getMyGraphicViewer

public org.eclipse.gef.GraphicalViewer getMyGraphicViewer()

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
Specified by:
doSave in interface org.eclipse.ui.ISaveablePart

isSaveOnCloseNeeded

public boolean isSaveOnCloseNeeded()
Specified by:
isSaveOnCloseNeeded in interface org.eclipse.ui.ISaveablePart

doSaveAs

public void doSaveAs()
Specified by:
doSaveAs in interface org.eclipse.ui.ISaveablePart

isSaveAsAllowed

public boolean isSaveAsAllowed()
Specified by:
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart

propertyChange

public void propertyChange(PropertyChangeEvent arg0)
Specified by:
propertyChange in interface PropertyChangeListener