org.eclipse.emf.mwe.ewm.presentation
Class WorkflowEditor

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.ui.part.MultiPageEditorPart
                  extended by org.eclipse.emf.mwe.ewm.presentation.WorkflowEditor
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, org.eclipse.core.runtime.IExecutableExtension, org.eclipse.emf.common.ui.viewer.IViewerProvider, org.eclipse.emf.edit.domain.IEditingDomainProvider, org.eclipse.jface.action.IMenuListener, org.eclipse.jface.dialogs.IPageChangeProvider, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.ui.ide.IGotoMarker, 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 class WorkflowEditor
extends org.eclipse.ui.part.MultiPageEditorPart
implements org.eclipse.emf.edit.domain.IEditingDomainProvider, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.jface.action.IMenuListener, org.eclipse.emf.common.ui.viewer.IViewerProvider, org.eclipse.ui.ide.IGotoMarker

This is an example of a Workflow model editor.

EMF generated code

Nested Class Summary
 class WorkflowEditor.ReverseAdapterFactoryContentProvider
           
 
Field Summary
protected  org.eclipse.emf.edit.provider.ComposedAdapterFactory adapterFactory
          This is the one adapter factory used for providing views of the model.
protected  java.util.Collection<org.eclipse.emf.ecore.resource.Resource> changedResources
          Resources that have been changed since last activation.
protected  org.eclipse.ui.views.contentoutline.IContentOutlinePage contentOutlinePage
          This is the content outline page.
protected  org.eclipse.jface.action.IStatusLineManager contentOutlineStatusLineManager
          This is a kludge...
protected  org.eclipse.jface.viewers.TreeViewer contentOutlineViewer
          This is the content outline page's viewer.
protected  org.eclipse.jface.viewers.Viewer currentViewer
          This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.
protected  org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain editingDomain
          This keeps track of the editing domain that is used to track all changes to the model.
protected  org.eclipse.jface.viewers.ISelection editorSelection
          This keeps track of the selection of the editor as a whole.
protected  org.eclipse.emf.common.ui.MarkerHelper markerHelper
          The MarkerHelper is responsible for creating workspace resource markers presented in Eclipse's Problems View.
protected  org.eclipse.ui.IPartListener partListener
          This listens for when the outline becomes active
protected  org.eclipse.emf.ecore.util.EContentAdapter problemIndicationAdapter
          Adapter used to update the problem indication when resources are demanded loaded.
protected  org.eclipse.ui.views.properties.PropertySheetPage propertySheetPage
          This is the property sheet page.
protected  java.util.Collection<org.eclipse.emf.ecore.resource.Resource> removedResources
          Resources that have been removed since last activation.
protected  org.eclipse.core.resources.IResourceChangeListener resourceChangeListener
          This listens for workspace changes.
protected  java.util.Map<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.common.util.Diagnostic> resourceToDiagnosticMap
          Map to store the diagnostic associated with a resource.
protected  java.util.Collection<org.eclipse.emf.ecore.resource.Resource> savedResources
          Resources that have been saved.
protected  org.eclipse.jface.viewers.ISelectionChangedListener selectionChangedListener
          This listens to which ever viewer is active.
protected  java.util.Collection<org.eclipse.jface.viewers.ISelectionChangedListener> selectionChangedListeners
          This keeps track of all the ISelectionChangedListeners that are listening to this editor.
protected  org.eclipse.jface.viewers.TreeViewer selectionViewer
          This is the viewer that shadows the selection in the content outline.
protected  boolean updateProblemIndication
          Controls whether the problem indication should be updated.
 
Fields inherited from class org.eclipse.ui.part.MultiPageEditorPart
PAGE_CONTAINER_SITE
 
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUT
 
Fields inherited from interface org.eclipse.ui.IWorkbenchPart
PROP_TITLE
 
Constructor Summary
WorkflowEditor()
          This creates a model editor.
 
Method Summary
 void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
          This implements ISelectionProvider.
 org.eclipse.emf.common.util.Diagnostic analyzeResourceProblems(org.eclipse.emf.ecore.resource.Resource resource, java.lang.Exception exception)
          Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any).
protected  void createContextMenuFor(org.eclipse.jface.viewers.StructuredViewer viewer)
          This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 void createModel()
          This is the method called to load a resource into the editing domain's resource set based on the editor's input.
 void createPages()
          This is the method used by the framework to install your own controls.
 void dispose()
           
 void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
          This is for implementing IEditorPart and simply saves the model file.
 void doSaveAs()
          This also changes the editor's input.
protected  void doSaveAs(org.eclipse.emf.common.util.URI uri, org.eclipse.ui.IEditorInput editorInput)
           
protected  void firePropertyChange(int action)
          This is here for the listener to be able to call it.
 org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor getActionBarContributor()
           
 org.eclipse.ui.IActionBars getActionBars()
           
 java.lang.Object getAdapter(java.lang.Class key)
          This is how the framework determines which interfaces we implement.
 org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory()
           
 org.eclipse.ui.views.contentoutline.IContentOutlinePage getContentOutlinePage()
          This accesses a cached version of the content outliner.
 org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
          This returns the editing domain as required by the IEditingDomainProvider interface.
 org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()
          This accesses a cached version of the property sheet.
 org.eclipse.jface.viewers.ISelection getSelection()
          This implements ISelectionProvider to return this editor's overall selection.
 org.eclipse.jface.viewers.Viewer getViewer()
          This returns the viewer as required by the IViewerProvider interface.
 void gotoMarker(org.eclipse.core.resources.IMarker marker)
           
protected  void handleActivate()
          Handles activation of the editor or it's associated views.
protected  void handleChangedResources()
          Handles what to do with changed resources on activation.
 void handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection)
          This deals with how we want selection in the outliner to affect the other views.
protected  boolean handleDirtyConflict()
          Shows a dialog that asks if conflicting changes should be discarded.
protected  void hideTabs()
          If there is just one page in the multi-page editor part, this hides the single tab at the bottom.
 void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput)
          This is called during startup.
protected  void initializeEditingDomain()
          This sets up the editing domain for the model editor.
 boolean isDirty()
          This is for implementing IEditorPart and simply tests the command stack.
protected  boolean isPersisted(org.eclipse.emf.ecore.resource.Resource resource)
          This returns whether something has been persisted to the URI of the specified resource.
 boolean isSaveAsAllowed()
          This always returns true because it is not currently supported.
 void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
          This implements IMenuListener to help fill the context menus with contributions from the Edit menu.
protected  void pageChange(int pageIndex)
          This is used to track the active viewer.
 void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
          This implements ISelectionProvider.
 void setCurrentViewer(org.eclipse.jface.viewers.Viewer viewer)
          This makes sure that one content viewer, either for the current page or the outline view, if it has focus, is the current one.
 void setFocus()
           
 void setSelection(org.eclipse.jface.viewers.ISelection selection)
          This implements ISelectionProvider to set this editor's overall selection.
 void setSelectionToViewer(java.util.Collection<?> collection)
          This sets the selection into whichever viewer is active.
 void setStatusLineManager(org.eclipse.jface.viewers.ISelection selection)
           
protected  boolean showOutlineView()
          Returns whether the outline view should be presented to the user.
protected  void showTabs()
          If there is more than one page in the multi-page editor part, this shows the tabs at the bottom.
protected  void updateProblemIndication()
          Updates the problems indication with the information described in the specified diagnostic.
 
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
activateSite, addPage, addPage, addPage, addPage, addPageChangedListener, createPageContainer, createPartControl, createSite, deactivateSite, findEditors, getActiveEditor, getActivePage, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageSite, getPageText, getSelectedPage, handlePropertyChange, initializePageSwitching, removePage, removePageChangedListener, setActiveEditor, setActivePage, setControl, setPageImage, setPageText
 
Methods inherited from class org.eclipse.ui.part.EditorPart
checkSite, getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setContentDescription, setInitializationData, setInput, setInputWithNotify, setPartName
 
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, firePartPropertyChanged, 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
 

Field Detail

editingDomain

protected org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain editingDomain
This keeps track of the editing domain that is used to track all changes to the model.

EMF generated code

adapterFactory

protected org.eclipse.emf.edit.provider.ComposedAdapterFactory adapterFactory
This is the one adapter factory used for providing views of the model.

EMF generated code

contentOutlinePage

protected org.eclipse.ui.views.contentoutline.IContentOutlinePage contentOutlinePage
This is the content outline page.

EMF generated code

contentOutlineStatusLineManager

protected org.eclipse.jface.action.IStatusLineManager contentOutlineStatusLineManager
This is a kludge...

EMF generated code

contentOutlineViewer

protected org.eclipse.jface.viewers.TreeViewer contentOutlineViewer
This is the content outline page's viewer.

EMF generated code

propertySheetPage

protected org.eclipse.ui.views.properties.PropertySheetPage propertySheetPage
This is the property sheet page.

EMF generated code

selectionViewer

protected org.eclipse.jface.viewers.TreeViewer selectionViewer
This is the viewer that shadows the selection in the content outline. The parent relation must be correctly defined for this to work.

EMF generated code

currentViewer

protected org.eclipse.jface.viewers.Viewer currentViewer
This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer.

EMF generated code

selectionChangedListener

protected org.eclipse.jface.viewers.ISelectionChangedListener selectionChangedListener
This listens to which ever viewer is active.

EMF generated code

selectionChangedListeners

protected java.util.Collection<org.eclipse.jface.viewers.ISelectionChangedListener> selectionChangedListeners
This keeps track of all the ISelectionChangedListeners that are listening to this editor.

EMF generated code

editorSelection

protected org.eclipse.jface.viewers.ISelection editorSelection
This keeps track of the selection of the editor as a whole.

EMF generated code

markerHelper

protected org.eclipse.emf.common.ui.MarkerHelper markerHelper
The MarkerHelper is responsible for creating workspace resource markers presented in Eclipse's Problems View.

EMF generated code

partListener

protected org.eclipse.ui.IPartListener partListener
This listens for when the outline becomes active

EMF generated code

removedResources

protected java.util.Collection<org.eclipse.emf.ecore.resource.Resource> removedResources
Resources that have been removed since last activation.

EMF generated code

changedResources

protected java.util.Collection<org.eclipse.emf.ecore.resource.Resource> changedResources
Resources that have been changed since last activation.

EMF generated code

savedResources

protected java.util.Collection<org.eclipse.emf.ecore.resource.Resource> savedResources
Resources that have been saved.

EMF generated code

resourceToDiagnosticMap

protected java.util.Map<org.eclipse.emf.ecore.resource.Resource,org.eclipse.emf.common.util.Diagnostic> resourceToDiagnosticMap
Map to store the diagnostic associated with a resource.

EMF generated code

updateProblemIndication

protected boolean updateProblemIndication
Controls whether the problem indication should be updated.

EMF generated code

problemIndicationAdapter

protected org.eclipse.emf.ecore.util.EContentAdapter problemIndicationAdapter
Adapter used to update the problem indication when resources are demanded loaded.

EMF generated code

resourceChangeListener

protected org.eclipse.core.resources.IResourceChangeListener resourceChangeListener
This listens for workspace changes.

EMF generated code
Constructor Detail

WorkflowEditor

public WorkflowEditor()
This creates a model editor.

EMF generated code
Method Detail

handleActivate

protected void handleActivate()
Handles activation of the editor or it's associated views.

EMF generated code

handleChangedResources

protected void handleChangedResources()
Handles what to do with changed resources on activation.

EMF generated code

updateProblemIndication

protected void updateProblemIndication()
Updates the problems indication with the information described in the specified diagnostic.

EMF generated code

handleDirtyConflict

protected boolean handleDirtyConflict()
Shows a dialog that asks if conflicting changes should be discarded.

EMF generated code

initializeEditingDomain

protected void initializeEditingDomain()
This sets up the editing domain for the model editor.

EMF generated code

firePropertyChange

protected void firePropertyChange(int action)
This is here for the listener to be able to call it.

Overrides:
firePropertyChange in class org.eclipse.ui.part.WorkbenchPart
EMF generated code

setSelectionToViewer

public void setSelectionToViewer(java.util.Collection<?> collection)
This sets the selection into whichever viewer is active.

EMF generated code

getEditingDomain

public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
This returns the editing domain as required by the IEditingDomainProvider interface. This is important for implementing the static methods of AdapterFactoryEditingDomain and for supporting CommandAction.

Specified by:
getEditingDomain in interface org.eclipse.emf.edit.domain.IEditingDomainProvider
EMF generated code

setCurrentViewer

public void setCurrentViewer(org.eclipse.jface.viewers.Viewer viewer)
This makes sure that one content viewer, either for the current page or the outline view, if it has focus, is the current one.

EMF generated code

getViewer

public org.eclipse.jface.viewers.Viewer getViewer()
This returns the viewer as required by the IViewerProvider interface.

Specified by:
getViewer in interface org.eclipse.emf.common.ui.viewer.IViewerProvider
EMF generated code

createContextMenuFor

protected void createContextMenuFor(org.eclipse.jface.viewers.StructuredViewer viewer)
This creates a context menu for the viewer and adds a listener as well registering the menu for extension.

EMF generated code

createModel

public void createModel()
This is the method called to load a resource into the editing domain's resource set based on the editor's input.

EMF generated code
NOT

analyzeResourceProblems

public org.eclipse.emf.common.util.Diagnostic analyzeResourceProblems(org.eclipse.emf.ecore.resource.Resource resource,
                                                                      java.lang.Exception exception)
Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any).

EMF generated code

createPages

public void createPages()
This is the method used by the framework to install your own controls.

Specified by:
createPages in class org.eclipse.ui.part.MultiPageEditorPart
EMF generated code

hideTabs

protected void hideTabs()
If there is just one page in the multi-page editor part, this hides the single tab at the bottom.

EMF generated code

showTabs

protected void showTabs()
If there is more than one page in the multi-page editor part, this shows the tabs at the bottom.

EMF generated code

pageChange

protected void pageChange(int pageIndex)
This is used to track the active viewer.

Overrides:
pageChange in class org.eclipse.ui.part.MultiPageEditorPart
EMF generated code

getAdapter

public java.lang.Object getAdapter(java.lang.Class key)
This is how the framework determines which interfaces we implement.

Specified by:
getAdapter in interface org.eclipse.core.runtime.IAdaptable
Overrides:
getAdapter in class org.eclipse.ui.part.MultiPageEditorPart
EMF generated code

getContentOutlinePage

public org.eclipse.ui.views.contentoutline.IContentOutlinePage getContentOutlinePage()
This accesses a cached version of the content outliner.

EMF generated code

getPropertySheetPage

public org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()
This accesses a cached version of the property sheet.

EMF generated code

handleContentOutlineSelection

public void handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection)
This deals with how we want selection in the outliner to affect the other views.

EMF generated code

isDirty

public boolean isDirty()
This is for implementing IEditorPart and simply tests the command stack.

Specified by:
isDirty in interface org.eclipse.ui.ISaveablePart
Overrides:
isDirty in class org.eclipse.ui.part.MultiPageEditorPart
EMF generated code

doSave

public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
This is for implementing IEditorPart and simply saves the model file.

Specified by:
doSave in interface org.eclipse.ui.ISaveablePart
Specified by:
doSave in class org.eclipse.ui.part.EditorPart
EMF generated code
NOT

isPersisted

protected boolean isPersisted(org.eclipse.emf.ecore.resource.Resource resource)
This returns whether something has been persisted to the URI of the specified resource. The implementation uses the URI converter from the editor's resource set to try to open an input stream.

EMF generated code

isSaveAsAllowed

public boolean isSaveAsAllowed()
This always returns true because it is not currently supported.

Specified by:
isSaveAsAllowed in interface org.eclipse.ui.ISaveablePart
Specified by:
isSaveAsAllowed in class org.eclipse.ui.part.EditorPart
EMF generated code

doSaveAs

public void doSaveAs()
This also changes the editor's input.

Specified by:
doSaveAs in interface org.eclipse.ui.ISaveablePart
Specified by:
doSaveAs in class org.eclipse.ui.part.EditorPart
EMF generated code

doSaveAs

protected void doSaveAs(org.eclipse.emf.common.util.URI uri,
                        org.eclipse.ui.IEditorInput editorInput)

EMF generated code

gotoMarker

public void gotoMarker(org.eclipse.core.resources.IMarker marker)

Specified by:
gotoMarker in interface org.eclipse.ui.ide.IGotoMarker
EMF generated code

init

public void init(org.eclipse.ui.IEditorSite site,
                 org.eclipse.ui.IEditorInput editorInput)
This is called during startup.

Specified by:
init in interface org.eclipse.ui.IEditorPart
Overrides:
init in class org.eclipse.ui.part.MultiPageEditorPart
EMF generated code

setFocus

public void setFocus()

Specified by:
setFocus in interface org.eclipse.ui.IWorkbenchPart
Overrides:
setFocus in class org.eclipse.ui.part.MultiPageEditorPart
EMF generated code

addSelectionChangedListener

public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
This implements ISelectionProvider.

Specified by:
addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
EMF generated code

removeSelectionChangedListener

public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
This implements ISelectionProvider.

Specified by:
removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
EMF generated code

getSelection

public org.eclipse.jface.viewers.ISelection getSelection()
This implements ISelectionProvider to return this editor's overall selection.

Specified by:
getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
EMF generated code

setSelection

public void setSelection(org.eclipse.jface.viewers.ISelection selection)
This implements ISelectionProvider to set this editor's overall selection. Calling this result will notify the listeners.

Specified by:
setSelection in interface org.eclipse.jface.viewers.ISelectionProvider
EMF generated code

setStatusLineManager

public void setStatusLineManager(org.eclipse.jface.viewers.ISelection selection)

EMF generated code

menuAboutToShow

public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
This implements IMenuListener to help fill the context menus with contributions from the Edit menu.

Specified by:
menuAboutToShow in interface org.eclipse.jface.action.IMenuListener
EMF generated code

getActionBarContributor

public org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor getActionBarContributor()

EMF generated code

getActionBars

public org.eclipse.ui.IActionBars getActionBars()

EMF generated code

getAdapterFactory

public org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory()

EMF generated code

dispose

public void dispose()

Specified by:
dispose in interface org.eclipse.ui.IWorkbenchPart
Overrides:
dispose in class org.eclipse.ui.part.MultiPageEditorPart
EMF generated code

showOutlineView

protected boolean showOutlineView()
Returns whether the outline view should be presented to the user.

EMF generated code