org.eclipse.gmt.umlx.editor
Class AbstractEditor

java.lang.Object
  extended by org.eclipse.core.commands.common.EventManager
      extended by org.eclipse.ui.part.WorkbenchPart
          extended by org.eclipse.ui.part.EditorPart
              extended by org.eclipse.gmt.umlx.editor.AbstractEditor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.gef.commands.CommandStackListener, ISheetEditor, org.eclipse.ui.ide.IGotoMarker, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.part.IWorkbenchPartOrientation
Direct Known Subclasses:
AbstractDiagramEditor, AbstractSheetEditor

public abstract class AbstractEditor
extends org.eclipse.ui.part.EditorPart
implements org.eclipse.gef.commands.CommandStackListener, org.eclipse.ui.ide.IGotoMarker, ISheetEditor


Field Summary
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
AbstractEditor()
           
 
Method Summary
 void commandStackChanged(java.util.EventObject event)
          When the command stack changes, the actions interested in the command stack are updated.
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
          Realizes the Editor by creating it's Control.
 void dispose()
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void doSaveAs()
           
 java.lang.Object getAdapter(java.lang.Class adapter)
          Returns the adapter for the specified key.
 SharedCommandStack getCommandStack()
          Returns the command stack.
abstract  ActiveEditDomain getEditDomain()
          Returns the edit domain.
 org.eclipse.gef.ui.views.palette.PalettePage getPalettePage()
           
 org.eclipse.gef.palette.PaletteRoot getPaletteRoot()
          Returns the PaletteRoot for the editor.
 org.eclipse.gef.ui.palette.PaletteViewer getPaletteViewer()
           
 java.lang.Class<? extends IRegimeContext> getRegimeContextClass()
           
 org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
          Returns the resource set.
 ISelectionSupervisor getSelectionSupervisor()
          Returns the selection syncronizer object.
 GSheet getSheet()
           
 SheetViewer getSheetViewer()
          Returns the sheet viewer.
abstract  org.eclipse.jface.action.IStatusLineManager getStatusLineManager()
           
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
           
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
          Sets the site and input for this editor then creates and initializes the actions.
 boolean isDirty()
          Returns true if the command stack is dirty
 boolean isSaveAsAllowed()
           
 void setFocus()
           
static void showStandardViews()
           
 
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPropertyListener, getContentDescription, getOrientation, getPartName, getSite, getTitle, getTitleImage, removePropertyListener, showBusy
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.ui.IWorkbenchPart
addPropertyListener, getSite, getTitle, getTitleImage, removePropertyListener
 

Constructor Detail

AbstractEditor

public AbstractEditor()
Method Detail

showStandardViews

public static void showStandardViews()

commandStackChanged

public void commandStackChanged(java.util.EventObject event)
When the command stack changes, the actions interested in the command stack are updated.

Specified by:
commandStackChanged in interface org.eclipse.gef.commands.CommandStackListener
Parameters:
event - the change event

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Realizes the Editor by creating it's Control.

WARNING: This method may or may not be called by the workbench prior to dispose().

Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart
Parameters:
parent - the parent composite

dispose

public void dispose()
Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.WorkbenchPart
See Also:
IWorkbenchPart.dispose()

doSave

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

doSaveAs

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

getAdapter

public java.lang.Object getAdapter(java.lang.Class adapter)
Returns the adapter for the specified key.

IMPORTANT certain requests, such as the property sheet, may be made before or after createPartControl(Composite) is called. The order is unspecified by the Workbench.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.part.WorkbenchPart
See Also:
IAdaptable.getAdapter(java.lang.Class)

getCommandStack

public SharedCommandStack getCommandStack()
Returns the command stack.

Returns:
the command stack

getEditDomain

public abstract ActiveEditDomain getEditDomain()
Description copied from interface: ISheetEditor
Returns the edit domain.

Specified by:
getEditDomain in interface ISheetEditor
Returns:
the edit domain

getPalettePage

public org.eclipse.gef.ui.views.palette.PalettePage getPalettePage()

getPaletteViewer

public org.eclipse.gef.ui.palette.PaletteViewer getPaletteViewer()

getPaletteRoot

public org.eclipse.gef.palette.PaletteRoot getPaletteRoot()
Returns the PaletteRoot for the editor.

Returns:
the palette root

getResourceSet

public org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
Returns the resource set.

Returns:
the resource set

getSelectionSupervisor

public ISelectionSupervisor getSelectionSupervisor()
Returns the selection syncronizer object. The synchronizer can be used to sync the selection of 2 or more EditPartViewers.

Returns:
the syncrhonizer

getSheet

public GSheet getSheet()
Specified by:
getSheet in interface ISheetEditor

getSheetViewer

public SheetViewer getSheetViewer()
Returns the sheet viewer.

Specified by:
getSheetViewer in interface ISheetEditor
Returns:
the sheet viewer

getStatusLineManager

public abstract org.eclipse.jface.action.IStatusLineManager getStatusLineManager()

gotoMarker

public void gotoMarker(org.eclipse.core.resources.IMarker marker)
Specified by:
gotoMarker in interface org.eclipse.ui.ide.IGotoMarker

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput input)
Sets the site and input for this editor then creates and initializes the actions. Subclasses may extend this method, but should always call super.init(site, input) .

Specified by:
init in interface org.eclipse.ui.IEditorPart
Specified by:
init in class org.eclipse.ui.part.EditorPart
See Also:
IEditorPart.init(IEditorSite, IEditorInput)

isDirty

public boolean isDirty()
Returns true if the command stack is dirty

Specified by:
isDirty in interface org.eclipse.ui.ISaveablePart
Specified by:
isDirty in class org.eclipse.ui.part.EditorPart
See Also:
ISaveablePart.isDirty()

isSaveAsAllowed

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

setFocus

public void setFocus()
Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Specified by:
setFocus in class org.eclipse.ui.part.WorkbenchPart
See Also:
IWorkbenchPart.setFocus()

getRegimeContextClass

public java.lang.Class<? extends IRegimeContext> getRegimeContextClass()
Specified by:
getRegimeContextClass in interface ISheetEditor