|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.commands.common.EventManager
org.eclipse.ui.part.WorkbenchPart
org.eclipse.ui.part.EditorPart
org.eclipse.ui.part.MultiPageEditorPart
org.eclipse.emf.ecore.presentation.EcoreEditor
public class EcoreEditor
This is an example of a Ecore model editor.
Nested Class Summary | |
---|---|
class |
EcoreEditor.ReverseAdapterFactoryContentProvider
|
static class |
EcoreEditor.XML
|
Field Summary | |
---|---|
protected ComposedAdapterFactory |
adapterFactory
This is the one adapter factory used for providing views of the model |
protected java.util.Collection<Resource> |
changedResources
Resources that have been changed since last activation |
protected IContentOutlinePage |
contentOutlinePage
This is the content outline page |
protected IStatusLineManager |
contentOutlineStatusLineManager
This is a kludge |
protected TreeViewer |
contentOutlineViewer
This is the content outline page's viewer |
protected 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 |
static java.lang.String |
ECORE_FILE_EXTENSION
|
protected AdapterFactoryEditingDomain |
editingDomain
This keeps track of the editing domain that is used to track all changes to the model |
protected ISelection |
editorSelection
This keeps track of the selection of the editor as a whole |
static java.lang.String |
EMOF_FILE_EXTENSION
|
protected MarkerHelper |
markerHelper
The MarkerHelper is responsible for creating workspace resource markers presented in Eclipse's Problems View |
protected IPartListener |
partListener
This listens for when the outline becomes active |
protected EContentAdapter |
problemIndicationAdapter
Adapter used to update the problem indication when resources are demanded loaded |
protected PropertySheetPage |
propertySheetPage
This is the property sheet page |
protected java.util.Collection<Resource> |
removedResources
Resources that have been removed since last activation |
protected IResourceChangeListener |
resourceChangeListener
This listens for workspace changes |
protected java.util.Map<Resource,Diagnostic> |
resourceToDiagnosticMap
Map to store the diagnostic associated with a resource |
protected java.util.Collection<Resource> |
savedResources
Resources that have been saved |
protected ISelectionChangedListener |
selectionChangedListener
This listens to which ever viewer is active |
protected java.util.Collection<ISelectionChangedListener> |
selectionChangedListeners
This keeps track of all the ISelectionChangedListener s that are listening to this editor |
protected 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 | |
---|---|
EcoreEditor()
This creates a model editor |
Method Summary | |
---|---|
void |
addSelectionChangedListener(ISelectionChangedListener listener)
This implements ISelectionProvider |
Diagnostic |
analyzeResourceProblems(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(StructuredViewer viewer)
|
protected void |
createContextMenuForGen(StructuredViewer viewer)
This creates a context menu for the viewer and adds a listener as well registering the menu for extension |
void |
createModel()
|
void |
createModelGen()
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(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(URI uri,
IEditorInput editorInput)
|
protected void |
firePropertyChange(int action)
This is here for the listener to be able to call it |
EditingDomainActionBarContributor |
getActionBarContributor()
|
IActionBars |
getActionBars()
|
java.lang.Object |
getAdapter(java.lang.Class key)
This is how the framework determines which interfaces we implement |
AdapterFactory |
getAdapterFactory()
|
IContentOutlinePage |
getContentOutlinePage()
This accesses a cached version of the content outliner |
EditingDomain |
getEditingDomain()
This returns the editing domain as required by the IEditingDomainProvider interface. |
IPropertySheetPage |
getPropertySheetPage()
This accesses a cached version of the property sheet |
ISelection |
getSelection()
This implements ISelectionProvider to return this editor's overall selection |
Viewer |
getViewer()
This returns the viewer as required by the IViewerProvider interface |
void |
gotoMarker(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(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(IEditorSite site,
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(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(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(ISelectionChangedListener listener)
This implements ISelectionProvider |
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 |
setFocus()
|
void |
setSelection(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(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 |
---|
protected AdapterFactoryEditingDomain editingDomain
protected ComposedAdapterFactory adapterFactory
protected IContentOutlinePage contentOutlinePage
protected IStatusLineManager contentOutlineStatusLineManager
protected TreeViewer contentOutlineViewer
protected PropertySheetPage propertySheetPage
protected TreeViewer selectionViewer
protected Viewer currentViewer
protected ISelectionChangedListener selectionChangedListener
protected java.util.Collection<ISelectionChangedListener> selectionChangedListeners
ISelectionChangedListener
s that are listening to this editor.
protected ISelection editorSelection
protected MarkerHelper markerHelper
protected IPartListener partListener
protected java.util.Collection<Resource> removedResources
protected java.util.Collection<Resource> changedResources
protected java.util.Collection<Resource> savedResources
protected java.util.Map<Resource,Diagnostic> resourceToDiagnosticMap
protected boolean updateProblemIndication
protected EContentAdapter problemIndicationAdapter
protected IResourceChangeListener resourceChangeListener
public static final java.lang.String ECORE_FILE_EXTENSION
public static final java.lang.String EMOF_FILE_EXTENSION
Constructor Detail |
---|
public EcoreEditor()
Method Detail |
---|
protected void handleActivate()
protected void handleChangedResources()
protected void updateProblemIndication()
protected boolean handleDirtyConflict()
protected void initializeEditingDomain()
protected void firePropertyChange(int action)
firePropertyChange
in class WorkbenchPart
public void setSelectionToViewer(java.util.Collection<?> collection)
public EditingDomain getEditingDomain()
IEditingDomainProvider
interface.
This is important for implementing the static methods of AdapterFactoryEditingDomain
and for supporting CommandAction
.
getEditingDomain
in interface IEditingDomainProvider
public void setCurrentViewer(Viewer viewer)
public Viewer getViewer()
IViewerProvider
interface.
getViewer
in interface IViewerProvider
protected void createContextMenuForGen(StructuredViewer viewer)
protected void createContextMenuFor(StructuredViewer viewer)
public void createModelGen()
public void createModel()
public Diagnostic analyzeResourceProblems(Resource resource, java.lang.Exception exception)
public void createPages()
createPages
in class MultiPageEditorPart
protected void hideTabs()
protected void showTabs()
protected void pageChange(int pageIndex)
pageChange
in class MultiPageEditorPart
public java.lang.Object getAdapter(java.lang.Class key)
getAdapter
in interface IAdaptable
getAdapter
in class MultiPageEditorPart
public IContentOutlinePage getContentOutlinePage()
public IPropertySheetPage getPropertySheetPage()
public void handleContentOutlineSelection(ISelection selection)
public boolean isDirty()
IEditorPart
and simply tests the command stack.
isDirty
in interface ISaveablePart
isDirty
in class MultiPageEditorPart
public void doSave(IProgressMonitor progressMonitor)
IEditorPart
and simply saves the model file.
doSave
in interface ISaveablePart
doSave
in class EditorPart
protected boolean isPersisted(Resource resource)
public boolean isSaveAsAllowed()
isSaveAsAllowed
in interface ISaveablePart
isSaveAsAllowed
in class EditorPart
public void doSaveAs()
doSaveAs
in interface ISaveablePart
doSaveAs
in class EditorPart
protected void doSaveAs(URI uri, IEditorInput editorInput)
public void gotoMarker(IMarker marker)
gotoMarker
in interface IGotoMarker
public void init(IEditorSite site, IEditorInput editorInput)
init
in interface IEditorPart
init
in class MultiPageEditorPart
public void setFocus()
setFocus
in interface IWorkbenchPart
setFocus
in class MultiPageEditorPart
public void addSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvider
.
addSelectionChangedListener
in interface ISelectionProvider
public void removeSelectionChangedListener(ISelectionChangedListener listener)
ISelectionProvider
.
removeSelectionChangedListener
in interface ISelectionProvider
public ISelection getSelection()
ISelectionProvider
to return this editor's overall selection.
getSelection
in interface ISelectionProvider
public void setSelection(ISelection selection)
ISelectionProvider
to set this editor's overall selection.
Calling this result will notify the listeners.
setSelection
in interface ISelectionProvider
public void setStatusLineManager(ISelection selection)
public void menuAboutToShow(IMenuManager menuManager)
IMenuListener
to help fill the context menus with contributions from the Edit menu.
menuAboutToShow
in interface IMenuListener
public EditingDomainActionBarContributor getActionBarContributor()
public IActionBars getActionBars()
public AdapterFactory getAdapterFactory()
public void dispose()
dispose
in interface IWorkbenchPart
dispose
in class MultiPageEditorPart
protected boolean showOutlineView()
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |