org.eclipse.gmf.runtime.lite.parts
Class DiagramEditor

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.gmf.runtime.lite.parts.DiagramEditor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.ui.IEditorPart, org.eclipse.ui.ISaveablePart, org.eclipse.ui.IWorkbenchPart, org.eclipse.ui.IWorkbenchPart2, org.eclipse.ui.IWorkbenchPart3, org.eclipse.ui.part.IWorkbenchPartOrientation

public abstract class DiagramEditor
extends org.eclipse.ui.part.EditorPart

This class serves as the base class for the generated diagram editors.

Author:
bblajer

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
DiagramEditor()
           
 
Method Summary
protected  void addAction(org.eclipse.jface.action.IAction action)
          Adds an action to this editor's ActionRegistry.
protected  void addEditorAction(org.eclipse.gef.ui.actions.WorkbenchPartAction action)
          Adds an editor action to this editor.
protected  void addEditPartAction(org.eclipse.gef.ui.actions.SelectionAction action)
          Adds an EditPart action to this editor.
protected  void addStackAction(org.eclipse.gef.ui.actions.StackAction action)
          Adds an CommandStack action to this editor.
 void configureGraphicalViewer()
           
abstract  void configurePalette(org.eclipse.gef.palette.PaletteRoot paletteRoot)
           
protected abstract  void createActions()
           
protected  org.eclipse.gef.EditDomain createEditDomain()
          Creates edit domain that will be used for the editor.
protected  org.eclipse.emf.transaction.TransactionalEditingDomain createEditingDomain()
          Returns the editing domain instance to be used for the diagram if none may be inferred from the input.
 void createPartControl(org.eclipse.swt.widgets.Composite parent)
           
 void dispose()
           
 void doSaveAs()
           
protected  org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()
           
 Object getAdapter(Class type)
           
protected  org.eclipse.gef.commands.CommandStack getCommandStack()
           
protected  int getDefaultOutlineViewMode()
          Returns the initial display mode for the outline page to be shown.
protected  IDiagramLayouter getDiagramLayouter()
           
abstract  org.eclipse.emf.common.notify.AdapterFactory getDomainAdapterFactory()
           
protected  org.eclipse.gef.EditDomain getEditDomain()
           
 org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()
           
protected  org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(org.eclipse.ui.IEditorInput input)
          Returns the editing domain instance to be used for the specified input.
protected  org.eclipse.gef.GraphicalViewer getGraphicalViewer()
           
protected  org.eclipse.ui.views.contentoutline.IContentOutlinePage getOutlinePage()
           
protected  org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()
           
protected  Map<?,?> getSaveOptions()
          Returns the options with which the resources will be saved.
 org.eclipse.ui.IWorkbenchPartSite getSite()
           
protected  double[] getZoomLevels()
           
protected  org.eclipse.gef.editparts.ZoomManager getZoomManager()
           
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput input)
           
abstract  void initializeGraphicalViewer()
           
 boolean isDirty()
           
abstract  boolean isFlyoutPalette()
           
 boolean isSaveAsAllowed()
           
protected  org.eclipse.emf.transaction.TransactionalEditingDomain reuseEditingDomain(org.eclipse.ui.IEditorInput input)
          Returns the editing domain that is used by other editors with the same input.
protected  void save(org.eclipse.core.runtime.IProgressMonitor monitor)
           
 void setFocus()
           
 
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, doSave, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, firePropertyChange, getConfigurationElement, getContentDescription, getDefaultImage, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, 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, getSite, getTitle, getTitleImage, removePropertyListener
 

Constructor Detail

DiagramEditor

public DiagramEditor()
Method Detail

save

protected void save(org.eclipse.core.runtime.IProgressMonitor monitor)
             throws org.eclipse.core.runtime.CoreException
Throws:
org.eclipse.core.runtime.CoreException

getSaveOptions

protected Map<?,?> getSaveOptions()
Returns the options with which the resources will be saved. Subclasses should override.


getEditingDomain

public final org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain()

getEditDomain

protected final org.eclipse.gef.EditDomain getEditDomain()

getCommandStack

protected final org.eclipse.gef.commands.CommandStack getCommandStack()

getZoomManager

protected final org.eclipse.gef.editparts.ZoomManager getZoomManager()

getActionRegistry

protected final org.eclipse.gef.ui.actions.ActionRegistry getActionRegistry()

getGraphicalViewer

protected final org.eclipse.gef.GraphicalViewer getGraphicalViewer()

getPropertySheetPage

protected org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()

getOutlinePage

protected org.eclipse.ui.views.contentoutline.IContentOutlinePage getOutlinePage()

getDiagramLayouter

protected IDiagramLayouter getDiagramLayouter()

getDefaultOutlineViewMode

protected int getDefaultOutlineViewMode()
Returns the initial display mode for the outline page to be shown. Possible values are DiagramContentOutlinePage.ID_OUTLINE and DiagramContentOutlinePage.ID_OVERVIEW. By default, the outline page starts in the overview mode. Subclasses may reimplement.


isSaveAsAllowed

public boolean isSaveAsAllowed()
Specified by:
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart
Specified by:
isSaveAsAllowed 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

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
Specified by:
init in class org.eclipse.ui.part.EditorPart
Throws:
org.eclipse.ui.PartInitException

dispose

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

getAdapter

public Object getAdapter(Class type)
Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.part.WorkbenchPart

isDirty

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

addAction

protected void addAction(org.eclipse.jface.action.IAction action)
Adds an action to this editor's ActionRegistry. (This is a helper method.)

Parameters:
action - the action to add.

addEditorAction

protected void addEditorAction(org.eclipse.gef.ui.actions.WorkbenchPartAction action)
Adds an editor action to this editor.

Editor actions are actions that depend and work on the editor.

Parameters:
action - the editor action

addEditPartAction

protected void addEditPartAction(org.eclipse.gef.ui.actions.SelectionAction action)
Adds an EditPart action to this editor.

EditPart actions are actions that depend and work on the selected EditParts.

Parameters:
action - the EditPart action

addStackAction

protected void addStackAction(org.eclipse.gef.ui.actions.StackAction action)
Adds an CommandStack action to this editor.

CommandStack actions are actions that depend and work on the CommandStack.

Parameters:
action - the CommandStack action

createPartControl

public void createPartControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createPartControl in interface org.eclipse.ui.IWorkbenchPart
Specified by:
createPartControl in class org.eclipse.ui.part.WorkbenchPart

setFocus

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

getEditingDomain

protected org.eclipse.emf.transaction.TransactionalEditingDomain getEditingDomain(org.eclipse.ui.IEditorInput input)
Returns the editing domain instance to be used for the specified input. If this method returns null, a default instance will be created and used. By default, return null. Subclasses may reimplement.


reuseEditingDomain

protected org.eclipse.emf.transaction.TransactionalEditingDomain reuseEditingDomain(org.eclipse.ui.IEditorInput input)
Returns the editing domain that is used by other editors with the same input. This is done to correctly support "New Editor" operation that is available in the context menu of the editor tab.

Returns:

createEditingDomain

protected org.eclipse.emf.transaction.TransactionalEditingDomain createEditingDomain()
Returns the editing domain instance to be used for the diagram if none may be inferred from the input. Subclasses may extend or reimplement.


configureGraphicalViewer

public void configureGraphicalViewer()

getZoomLevels

protected double[] getZoomLevels()

configurePalette

public abstract void configurePalette(org.eclipse.gef.palette.PaletteRoot paletteRoot)

createEditDomain

protected org.eclipse.gef.EditDomain createEditDomain()
Creates edit domain that will be used for the editor. Subclasses may extend.


initializeGraphicalViewer

public abstract void initializeGraphicalViewer()

getDomainAdapterFactory

public abstract org.eclipse.emf.common.notify.AdapterFactory getDomainAdapterFactory()

isFlyoutPalette

public abstract boolean isFlyoutPalette()

createActions

protected abstract void createActions()

getSite

public org.eclipse.ui.IWorkbenchPartSite getSite()


Copyright © 2012. All Rights Reserved.