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 classUmaEditor.ReverseAdapterFactoryContentProvider -
Field Summary
Fields inherited from interface org.eclipse.ui.IEditorPart
PROP_DIRTY, PROP_INPUTFields 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 voidaddSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)This implementsISelectionProvider.org.eclipse.emf.common.util.DiagnosticanalyzeResourceProblems(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).voidcreateModel()This is the method called to load a resource into the editing domain's resource set based on the editor's input.voidcreatePages()This is the method used by the framework to install your own controls.voiddispose()voiddoSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)This is for implementingIEditorPartand simply saves the model file.voiddoSaveAs()This also changes the editor's input.org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributorgetActionBarContributor()org.eclipse.ui.IActionBarsgetActionBars()<T> TgetAdapter(java.lang.Class<T> key)This is how the framework determines which interfaces we implement.org.eclipse.emf.common.notify.AdapterFactorygetAdapterFactory()org.eclipse.ui.views.contentoutline.IContentOutlinePagegetContentOutlinePage()This accesses a cached version of the content outliner.org.eclipse.emf.edit.domain.EditingDomaingetEditingDomain()This returns the editing domain as required by theIEditingDomainProviderinterface.org.eclipse.ui.views.properties.IPropertySheetPagegetPropertySheetPage()This accesses a cached version of the property sheet.org.eclipse.jface.viewers.ISelectiongetSelection()This implementsISelectionProviderto return this editor's overall selection.org.eclipse.jface.viewers.ViewergetViewer()This returns the viewer as required by theIViewerProviderinterface.voidgotoMarker(org.eclipse.core.resources.IMarker marker)voidhandleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection)This deals with how we want selection in the outliner to affect the other views.voidinit(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput)This is called during startup.booleanisDirty()This is for implementingIEditorPartand simply tests the command stack.booleanisSaveAsAllowed()This always returns true because it is not currently supported.voidmenuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)This implementsIMenuListenerto help fill the context menus with contributions from the Edit menu.voidremoveSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)This implementsISelectionProvider.voidsetCurrentViewer(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.voidsetCurrentViewerPane(org.eclipse.emf.common.ui.ViewerPane viewerPane)voidsetFocus()voidsetSelection(org.eclipse.jface.viewers.ISelection selection)This implementsISelectionProviderto set this editor's overall selection.voidsetSelectionToViewer(java.util.Collection<?> collection)This sets the selection into whichever viewer is active.voidsetStatusLineManager(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, setActiveEditorMethods inherited from class org.eclipse.ui.part.EditorPart
getEditorInput, getEditorSite, getTitleToolTip, isSaveOnCloseNeeded, setInitializationDataMethods inherited from class org.eclipse.ui.part.WorkbenchPart
addPartPropertyListener, addPropertyListener, getContentDescription, getOrientation, getPartName, getPartProperties, getPartProperty, getSite, getTitle, getTitleImage, removePartPropertyListener, removePropertyListener, setPartProperty, showBusyMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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 theIEditingDomainProviderinterface. This is important for implementing the static methods ofAdapterFactoryEditingDomainand for supportingCommandAction.- Specified by:
getEditingDomainin 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 theIViewerProviderinterface.- Specified by:
getViewerin 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:
getAdapterin interfaceorg.eclipse.core.runtime.IAdaptable- Overrides:
getAdapterin 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 implementingIEditorPartand simply tests the command stack.- Specified by:
isDirtyin interfaceorg.eclipse.ui.ISaveablePart- Overrides:
isDirtyin classorg.eclipse.ui.part.MultiPageEditorPart
-
doSave
public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)This is for implementingIEditorPartand simply saves the model file.- Specified by:
doSavein interfaceorg.eclipse.ui.ISaveablePart- Specified by:
doSavein classorg.eclipse.ui.part.EditorPart
-
isSaveAsAllowed
public boolean isSaveAsAllowed()This always returns true because it is not currently supported.- Specified by:
isSaveAsAllowedin interfaceorg.eclipse.ui.ISaveablePart- Specified by:
isSaveAsAllowedin classorg.eclipse.ui.part.EditorPart
-
doSaveAs
public void doSaveAs()This also changes the editor's input.- Specified by:
doSaveAsin interfaceorg.eclipse.ui.ISaveablePart- Specified by:
doSaveAsin classorg.eclipse.ui.part.EditorPart
-
gotoMarker
public void gotoMarker(org.eclipse.core.resources.IMarker marker)- Specified by:
gotoMarkerin 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:
initin interfaceorg.eclipse.ui.IEditorPart- Overrides:
initin classorg.eclipse.ui.part.MultiPageEditorPart
-
setFocus
public void setFocus()- Specified by:
setFocusin interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
setFocusin classorg.eclipse.ui.part.MultiPageEditorPart
-
addSelectionChangedListener
public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)This implementsISelectionProvider.- Specified by:
addSelectionChangedListenerin interfaceorg.eclipse.jface.viewers.ISelectionProvider
-
removeSelectionChangedListener
public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)This implementsISelectionProvider.- Specified by:
removeSelectionChangedListenerin interfaceorg.eclipse.jface.viewers.ISelectionProvider
-
getSelection
public org.eclipse.jface.viewers.ISelection getSelection()This implementsISelectionProviderto return this editor's overall selection.- Specified by:
getSelectionin interfaceorg.eclipse.jface.viewers.ISelectionProvider
-
setSelection
public void setSelection(org.eclipse.jface.viewers.ISelection selection)This implementsISelectionProviderto set this editor's overall selection. Calling this result will notify the listeners.- Specified by:
setSelectionin 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:
disposein interfaceorg.eclipse.ui.IWorkbenchPart- Overrides:
disposein classorg.eclipse.ui.part.MultiPageEditorPart
-