Package org.eclipse.epf.uma.presentation
Class UmaEditor
java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.ui.part.MultiPageEditorPart
org.eclipse.epf.uma.presentation.UmaEditor
- 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 UmaEditor
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 Uma model editor.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
UmaEditor.ReverseAdapterFactoryContentProvider
-
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
Constructors Constructor Description UmaEditor()
This creates a model editor. -
Method Summary
Modifier and Type Method Description void
addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
This implementsISelectionProvider
.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).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 implementingIEditorPart
and simply saves the model file.void
doSaveAs()
This also changes the editor's input.org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor
getActionBarContributor()
org.eclipse.ui.IActionBars
getActionBars()
<T> T
getAdapter(java.lang.Class<T> 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 theIEditingDomainProvider
interface.org.eclipse.ui.views.properties.IPropertySheetPage
getPropertySheetPage()
This accesses a cached version of the property sheet.org.eclipse.jface.viewers.ISelection
getSelection()
This implementsISelectionProvider
to return this editor's overall selection.org.eclipse.jface.viewers.Viewer
getViewer()
This returns the viewer as required by theIViewerProvider
interface.void
gotoMarker(org.eclipse.core.resources.IMarker marker)
void
handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection)
This deals with how we want selection in the outliner to affect the other views.void
init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput)
This is called during startup.boolean
isDirty()
This is for implementingIEditorPart
and simply tests the command stack.boolean
isSaveAsAllowed()
This always returns true because it is not currently supported.void
menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
This implementsIMenuListener
to help fill the context menus with contributions from the Edit menu.void
removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
This implementsISelectionProvider
.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
setCurrentViewerPane(org.eclipse.emf.common.ui.ViewerPane viewerPane)
void
setFocus()
void
setSelection(org.eclipse.jface.viewers.ISelection selection)
This implementsISelectionProvider
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)
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart
addPage, addPage, addPage, addPage, addPageChangedListener, createPartControl, findEditors, getActivePage, getSelectedPage, removePage, removePageChangedListener, setActiveEditor
Methods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationData
Methods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, 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 Details
-
UmaEditor
public UmaEditor()This creates a model editor.
-
-
Method Details
-
setSelectionToViewer
public void setSelectionToViewer(java.util.Collection<?> collection)This sets the selection into whichever viewer is active. -
getEditingDomain
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()This returns the editing domain as required by theIEditingDomainProvider
interface. This is important for implementing the static methods ofAdapterFactoryEditingDomain
and for supportingCommandAction
.- Specified by:
getEditingDomain
in interfaceorg.eclipse.emf.edit.domain.IEditingDomainProvider
-
setCurrentViewerPane
public void setCurrentViewerPane(org.eclipse.emf.common.ui.ViewerPane viewerPane) -
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. -
getViewer
public org.eclipse.jface.viewers.Viewer getViewer()This returns the viewer as required by theIViewerProvider
interface.- Specified by:
getViewer
in interfaceorg.eclipse.emf.common.ui.viewer.IViewerProvider
-
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. -
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). -
createPages
public void createPages()This is the method used by the framework to install your own controls. -
getAdapter
public <T> T getAdapter(java.lang.Class<T> key)This is how the framework determines which interfaces we implement.- Specified by:
getAdapter
in interfaceorg.eclipse.core.runtime.IAdaptable
- Overrides:
getAdapter
in classorg.eclipse.ui.part.MultiPageEditorPart
-
getContentOutlinePage
public org.eclipse.ui.views.contentoutline.IContentOutlinePage getContentOutlinePage()This accesses a cached version of the content outliner. -
getPropertySheetPage
public org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()This accesses a cached version of the property sheet. -
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. -
isDirty
public boolean isDirty()This is for implementingIEditorPart
and simply tests the command stack.- Specified by:
isDirty
in interfaceorg.eclipse.ui.ISaveablePart
- Overrides:
isDirty
in classorg.eclipse.ui.part.MultiPageEditorPart
-
doSave
public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)This is for implementingIEditorPart
and simply saves the model file.- Specified by:
doSave
in interfaceorg.eclipse.ui.ISaveablePart
- Specified by:
doSave
in classorg.eclipse.ui.part.EditorPart
-
isSaveAsAllowed
public boolean isSaveAsAllowed()This always returns true because it is not currently supported.- Specified by:
isSaveAsAllowed
in interfaceorg.eclipse.ui.ISaveablePart
- Specified by:
isSaveAsAllowed
in classorg.eclipse.ui.part.EditorPart
-
doSaveAs
public void doSaveAs()This also changes the editor's input.- Specified by:
doSaveAs
in interfaceorg.eclipse.ui.ISaveablePart
- Specified by:
doSaveAs
in classorg.eclipse.ui.part.EditorPart
-
gotoMarker
public void gotoMarker(org.eclipse.core.resources.IMarker marker)- Specified by:
gotoMarker
in interfaceorg.eclipse.ui.ide.IGotoMarker
-
init
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput)This is called during startup.- Specified by:
init
in interfaceorg.eclipse.ui.IEditorPart
- Overrides:
init
in classorg.eclipse.ui.part.MultiPageEditorPart
-
setFocus
public void setFocus()- Specified by:
setFocus
in interfaceorg.eclipse.ui.IWorkbenchPart
- Overrides:
setFocus
in classorg.eclipse.ui.part.MultiPageEditorPart
-
addSelectionChangedListener
public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)This implementsISelectionProvider
.- Specified by:
addSelectionChangedListener
in interfaceorg.eclipse.jface.viewers.ISelectionProvider
-
removeSelectionChangedListener
public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)This implementsISelectionProvider
.- Specified by:
removeSelectionChangedListener
in interfaceorg.eclipse.jface.viewers.ISelectionProvider
-
getSelection
public org.eclipse.jface.viewers.ISelection getSelection()This implementsISelectionProvider
to return this editor's overall selection.- Specified by:
getSelection
in interfaceorg.eclipse.jface.viewers.ISelectionProvider
-
setSelection
public void setSelection(org.eclipse.jface.viewers.ISelection selection)This implementsISelectionProvider
to set this editor's overall selection. Calling this result will notify the listeners.- Specified by:
setSelection
in interfaceorg.eclipse.jface.viewers.ISelectionProvider
-
setStatusLineManager
public void setStatusLineManager(org.eclipse.jface.viewers.ISelection selection) -
getActionBarContributor
public org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor getActionBarContributor() -
getActionBars
public org.eclipse.ui.IActionBars getActionBars() -
getAdapterFactory
public org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory() -
dispose
public void dispose()- Specified by:
dispose
in interfaceorg.eclipse.ui.IWorkbenchPart
- Overrides:
dispose
in classorg.eclipse.ui.part.MultiPageEditorPart
-