Class EMFProfileEditor
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.modelversioning.emfprofile.presentation.EMFProfileEditor
- All Implemented Interfaces:
IAdaptable
,IExecutableExtension
,IViewerProvider
,IEditingDomainProvider
,IMenuListener
,IPageChangeProvider
,ISelectionProvider
,IGotoMarker
,IEditorPart
,ISaveablePart
,IWorkbenchPart
,IWorkbenchPart2
,IWorkbenchPart3
,IWorkbenchPartOrientation
public class EMFProfileEditor
extends MultiPageEditorPart
implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker
This is an example of a EMFProfile model editor.
- Generated class or method.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprotected ComposedAdapterFactory
This is the one adapter factory used for providing views of the model.protected Collection<Resource>
Resources that have been changed since last activation.protected IContentOutlinePage
This is the content outline page.protected IStatusLineManager
This is a kludge...protected TreeViewer
This is the content outline page's viewer.protected Viewer
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 ViewerPane
This keeps track of the active viewer pane, in the book.protected AdapterFactoryEditingDomain
This keeps track of the editing domain that is used to track all changes to the model.protected ISelection
This keeps track of the selection of the editor as a whole.protected ListViewer
This shows how a list view works.protected MarkerHelper
The MarkerHelper is responsible for creating workspace resource markers presented in Eclipse's Problems View.protected TreeViewer
This inverts the roll of parent and child in the content provider and show parents as a tree.protected IPartListener
This listens for when the outline becomes activeprotected EContentAdapter
Adapter used to update the problem indication when resources are demanded loaded.protected PropertySheetPage
This is the property sheet page.protected Collection<Resource>
Resources that have been removed since last activation.protected IResourceChangeListener
This listens for workspace changes.protected Map<Resource,
Diagnostic> Map to store the diagnostic associated with a resource.protected Collection<Resource>
Resources that have been saved.protected ISelectionChangedListener
This listens to which ever viewer is active.protected Collection<ISelectionChangedListener>
This keeps track of all theISelectionChangedListener
s that are listening to this editor.protected TreeViewer
This is the viewer that shadows the selection in the content outline.protected TableViewer
This shows how a table view works.protected TreeViewer
This shows how a tree view works.protected TreeViewer
This shows how a tree view with columns works.protected boolean
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This implementsISelectionProvider
.analyzeResourceProblems
(Resource resource, Exception exception) Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any).protected void
Before save hook.protected void
createContextMenuFor
(StructuredViewer viewer) This creates a context menu for the viewer and adds a listener as well registering the menu for extension.void
This is the method called to load a resource into the editing domain's resource set based on the editor's input.void
This is the method used by the framework to install your own controls.void
dispose()
void
doSave
(IProgressMonitor progressMonitor) This is for implementingIEditorPart
and simply saves the model file.void
doSaveAs()
This also changes the editor's input.protected void
doSaveAs
(URI uri, IEditorInput editorInput) protected void
firePropertyChange
(int action) This is here for the listener to be able to call it.getAdapter
(Class key) This is how the framework determines which interfaces we implement.This accesses a cached version of the content outliner.This returns the editing domain as required by theIEditingDomainProvider
interface.This accesses a cached version of the property sheet.This implementsISelectionProvider
to return this editor's overall selection.This returns the viewer as required by theIViewerProvider
interface.void
gotoMarker
(IMarker marker) protected void
Handles activation of the editor or it's associated views.protected void
Handles what to do with changed resources on activation.void
handleContentOutlineSelection
(ISelection selection) This deals with how we want selection in the outliner to affect the other views.protected boolean
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
(IEditorSite site, IEditorInput editorInput) This is called during startup.protected void
This sets up the editing domain for the model editor.boolean
isDirty()
This is for implementingIEditorPart
and simply tests the command stack.protected boolean
isPersisted
(Resource resource) This returns whether something has been persisted to the URI of the specified resource.boolean
This always returns true because it is not currently supported.void
menuAboutToShow
(IMenuManager menuManager) This implementsIMenuListener
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
This implementsISelectionProvider
.void
setCurrentViewer
(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
(ViewerPane viewerPane) void
setFocus()
void
setSelection
(ISelection selection) This implementsISelectionProvider
to set this editor's overall selection.void
setSelectionToViewer
(Collection<?> collection) This sets the selection into whichever viewer is active.void
setStatusLineManager
(ISelection selection) protected boolean
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
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, createContainer, createItem, 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 Details
-
editingDomain
This keeps track of the editing domain that is used to track all changes to the model.- Generated class or method.
-
adapterFactory
This is the one adapter factory used for providing views of the model.- Generated class or method.
-
contentOutlinePage
This is the content outline page.- Generated class or method.
-
contentOutlineStatusLineManager
This is a kludge...- Generated class or method.
-
contentOutlineViewer
This is the content outline page's viewer.- Generated class or method.
-
propertySheetPage
This is the property sheet page.- Generated class or method.
-
selectionViewer
This is the viewer that shadows the selection in the content outline. The parent relation must be correctly defined for this to work.- Generated class or method.
-
parentViewer
This inverts the roll of parent and child in the content provider and show parents as a tree.- Generated class or method.
-
treeViewer
This shows how a tree view works.- Generated class or method.
-
listViewer
This shows how a list view works. A list viewer doesn't support icons.- Generated class or method.
-
tableViewer
This shows how a table view works. A table can be used as a list with icons.- Generated class or method.
-
treeViewerWithColumns
This shows how a tree view with columns works.- Generated class or method.
-
currentViewerPane
This keeps track of the active viewer pane, in the book.- Generated class or method.
-
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.- Generated class or method.
-
selectionChangedListener
This listens to which ever viewer is active.- Generated class or method.
-
selectionChangedListeners
This keeps track of all theISelectionChangedListener
s that are listening to this editor.- Generated class or method.
-
editorSelection
This keeps track of the selection of the editor as a whole.- Generated class or method.
-
markerHelper
The MarkerHelper is responsible for creating workspace resource markers presented in Eclipse's Problems View.- Generated class or method.
-
partListener
This listens for when the outline becomes active- Generated class or method.
-
removedResources
Resources that have been removed since last activation.- Generated class or method.
-
changedResources
Resources that have been changed since last activation.- Generated class or method.
-
savedResources
Resources that have been saved.- Generated class or method.
-
resourceToDiagnosticMap
Map to store the diagnostic associated with a resource.- Generated class or method.
-
updateProblemIndication
protected boolean updateProblemIndicationControls whether the problem indication should be updated.- Generated class or method.
-
problemIndicationAdapter
Adapter used to update the problem indication when resources are demanded loaded.- Generated class or method.
-
resourceChangeListener
This listens for workspace changes.- Generated class or method.
-
-
Constructor Details
-
EMFProfileEditor
public EMFProfileEditor()This creates a model editor.- Generated class or method.
-
-
Method Details
-
handleActivate
protected void handleActivate()Handles activation of the editor or it's associated views.- Generated class or method.
-
handleChangedResources
protected void handleChangedResources()Handles what to do with changed resources on activation.- Generated class or method.
-
updateProblemIndication
protected void updateProblemIndication()Updates the problems indication with the information described in the specified diagnostic.- Generated class or method.
-
handleDirtyConflict
protected boolean handleDirtyConflict()Shows a dialog that asks if conflicting changes should be discarded.- Generated class or method.
-
initializeEditingDomain
protected void initializeEditingDomain()This sets up the editing domain for the model editor.- Generated class or method.
-
firePropertyChange
protected void firePropertyChange(int action) This is here for the listener to be able to call it.- Overrides:
firePropertyChange
in classWorkbenchPart
- Generated class or method.
-
setSelectionToViewer
This sets the selection into whichever viewer is active.- Generated class or method.
-
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 interfaceIEditingDomainProvider
- Generated class or method.
-
setCurrentViewerPane
- Generated class or method.
-
setCurrentViewer
This makes sure that one content viewer, either for the current page or the outline view, if it has focus, is the current one.- Generated class or method.
-
getViewer
This returns the viewer as required by theIViewerProvider
interface.- Specified by:
getViewer
in interfaceIViewerProvider
- Generated class or method.
-
createContextMenuFor
This creates a context menu for the viewer and adds a listener as well registering the menu for extension.- Generated class or method.
-
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.- Generated class or method.
-
analyzeResourceProblems
Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any).- Generated class or method.
-
createPages
public void createPages()This is the method used by the framework to install your own controls.- Specified by:
createPages
in classMultiPageEditorPart
- Generated class or method.
-
hideTabs
protected void hideTabs()If there is just one page in the multi-page editor part, this hides the single tab at the bottom.- Generated class or method.
-
showTabs
protected void showTabs()If there is more than one page in the multi-page editor part, this shows the tabs at the bottom.- Generated class or method.
-
pageChange
protected void pageChange(int pageIndex) This is used to track the active viewer.- Overrides:
pageChange
in classMultiPageEditorPart
- Generated class or method.
-
getAdapter
This is how the framework determines which interfaces we implement.- Specified by:
getAdapter
in interfaceIAdaptable
- Overrides:
getAdapter
in classMultiPageEditorPart
- Generated class or method.
-
getContentOutlinePage
This accesses a cached version of the content outliner.- Generated class or method.
-
getPropertySheetPage
This accesses a cached version of the property sheet.- Generated class or method.
-
handleContentOutlineSelection
This deals with how we want selection in the outliner to affect the other views.- Generated class or method.
-
isDirty
public boolean isDirty()This is for implementingIEditorPart
and simply tests the command stack.- Specified by:
isDirty
in interfaceISaveablePart
- Overrides:
isDirty
in classMultiPageEditorPart
- Generated class or method.
-
doSave
This is for implementingIEditorPart
and simply saves the model file.- Specified by:
doSave
in interfaceISaveablePart
- Specified by:
doSave
in classEditorPart
- Generated class or method.
- NOT
-
beforeSave
protected void beforeSave()Before save hook. -
isPersisted
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.- Generated class or method.
-
isSaveAsAllowed
public boolean isSaveAsAllowed()This always returns true because it is not currently supported.- Specified by:
isSaveAsAllowed
in interfaceISaveablePart
- Specified by:
isSaveAsAllowed
in classEditorPart
- Generated class or method.
-
doSaveAs
public void doSaveAs()This also changes the editor's input.- Specified by:
doSaveAs
in interfaceISaveablePart
- Specified by:
doSaveAs
in classEditorPart
- Generated class or method.
-
doSaveAs
- Generated class or method.
-
gotoMarker
- Specified by:
gotoMarker
in interfaceIGotoMarker
- Generated class or method.
-
init
This is called during startup.- Specified by:
init
in interfaceIEditorPart
- Overrides:
init
in classMultiPageEditorPart
- Generated class or method.
-
setFocus
public void setFocus()- Specified by:
setFocus
in interfaceIWorkbenchPart
- Overrides:
setFocus
in classMultiPageEditorPart
- Generated class or method.
-
addSelectionChangedListener
This implementsISelectionProvider
.- Specified by:
addSelectionChangedListener
in interfaceISelectionProvider
- Generated class or method.
-
removeSelectionChangedListener
This implementsISelectionProvider
.- Specified by:
removeSelectionChangedListener
in interfaceISelectionProvider
- Generated class or method.
-
getSelection
This implementsISelectionProvider
to return this editor's overall selection.- Specified by:
getSelection
in interfaceISelectionProvider
- Generated class or method.
-
setSelection
This implementsISelectionProvider
to set this editor's overall selection. Calling this result will notify the listeners.- Specified by:
setSelection
in interfaceISelectionProvider
- Generated class or method.
-
setStatusLineManager
- Generated class or method.
-
getActionBarContributor
- Generated class or method.
-
getActionBars
- Generated class or method.
-
getAdapterFactory
- Generated class or method.
-
dispose
public void dispose()- Specified by:
dispose
in interfaceIWorkbenchPart
- Overrides:
dispose
in classMultiPageEditorPart
- Generated class or method.
-
showOutlineView
protected boolean showOutlineView()Returns whether the outline view should be presented to the user.- Generated class or method.
-