|
||||||||||
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
edu.cmu.sei.aadl.model.core.presentation.CoreEditor
public class CoreEditor
This is an example of a Core model editor. we added additional fields
Nested Class Summary | |
---|---|
class |
CoreEditor.ExtendsAdapterFactoryContentProvider
generates an instance view. |
class |
CoreEditor.FullAdapterFactoryContentProvider
generates an view with extends inherited elements |
class |
CoreEditor.InstanceAdapterFactoryContentProvider
generates an instance view. |
class |
CoreEditor.LibraryAdapterFactoryContentProvider
generates an instance view. |
class |
CoreEditor.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 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 |
static java.lang.String |
copyright
|
protected int |
currentPageID
keeps track of the current page ID |
protected org.eclipse.emf.ecore.resource.Resource |
currentResource
This keeps track of the resource that this CoreEditor instance works on |
protected org.eclipse.emf.common.util.URI |
currentSelectionUri
|
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.common.ui.ViewerPane |
currentViewerPane
This keeps track of the active viewer pane, in the book |
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 IGotoAObject |
gotoAObject
|
protected org.eclipse.jface.viewers.TreeViewer |
instanceViewer
instance viewer |
protected org.eclipse.jface.viewers.ListViewer |
listViewer
This shows how a list view works. |
protected org.eclipse.jface.viewers.TreeViewer |
parentViewer
This inverts the roll of parent and child in the content provider and show parents as a tree |
protected org.eclipse.ui.IPartListener |
partListener
This listens for when the outline becomes active |
protected org.eclipse.ui.views.properties.PropertySheetPage |
propertySheetPage
This is the property sheet page |
protected org.eclipse.core.resources.IResourceChangeListener |
resourceChangeListener
This listens for workspace changes |
protected org.eclipse.jface.viewers.ISelectionChangedListener |
selectionChangedListener
This listens to which ever viewer is active |
protected java.util.Collection |
selectionChangedListeners
This keeps track of all the ISelectionChangedListener s 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 org.eclipse.jface.viewers.TableViewer |
tableViewer
This shows how a table view works. |
protected org.eclipse.jface.viewers.TreeViewer |
treeViewer
This shows how a tree view works |
protected org.eclipse.jface.viewers.TreeViewer |
treeViewerWithColumns
This shows how a tree view with columns works |
Fields inherited from interface org.eclipse.ui.IEditorPart |
---|
PROP_DIRTY, PROP_INPUT |
Fields inherited from interface org.eclipse.ui.IWorkbenchPart |
---|
PROP_TITLE |
Constructor Summary | |
---|---|
CoreEditor()
This creates a model editor |
Method Summary | |
---|---|
void |
addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
This implements ISelectionProvider |
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 |
org.eclipse.ui.INavigationLocation |
createEmptyNavigationLocation()
|
org.eclipse.emf.ecore.resource.Resource |
createModel()
This is the method called to load a resource into the editing domain's resource set based on the editor's input |
org.eclipse.ui.INavigationLocation |
createNavigationLocation()
|
void |
createPages()
This is the method used by the framework to install your own controls |
void |
dispose()
added reload when file is dirty |
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.jface.viewers.TreeViewer |
getContentOutlineViewer()
|
protected org.eclipse.emf.ecore.resource.Resource |
getCurrentResource()
|
protected java.util.Collection |
getCurrentSelection()
|
org.eclipse.emf.edit.domain.EditingDomain |
getEditingDomain()
This returns the editing domain as required by the IEditingDomainProvider interface. |
IGotoAObject |
getGotoAObject()
|
org.eclipse.ui.views.properties.IPropertySheetPage |
getPropertySheetPage()
This accesses a cached version of the property sheet |
protected org.eclipse.emf.ecore.resource.ResourceSet |
getResourceSet()
get the resourceset for working on Aadl models this methods has been introduced to replace the calls on getresourceset on the editingDomain. |
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 |
gotoAObject(AObject obj)
go to the AObject. |
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 |
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 wether something has been persisted to the URI of the specified resource. |
boolean |
isSaveAsAllowed()
This always returns true because it is not currently supported |
protected void |
markInNavigationHistory()
Writes a check mark of the given situation into the navigation history. |
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 |
protected void |
setCurrentResource(org.eclipse.emf.ecore.resource.Resource res)
|
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 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)
|
Methods inherited from class org.eclipse.ui.part.MultiPageEditorPart |
---|
addPage, addPage, addPage, addPage, createPageContainer, createPartControl, createSite, findEditors, getActiveEditor, getActivePage, getContainer, getControl, getEditor, getPageCount, getPageImage, getPageText, handlePropertyChange, removePage, 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 |
---|
public static final java.lang.String copyright
protected org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain editingDomain
protected org.eclipse.emf.edit.provider.ComposedAdapterFactory adapterFactory
protected org.eclipse.ui.views.contentoutline.IContentOutlinePage contentOutlinePage
protected org.eclipse.jface.action.IStatusLineManager contentOutlineStatusLineManager
protected org.eclipse.jface.viewers.TreeViewer contentOutlineViewer
protected org.eclipse.ui.views.properties.PropertySheetPage propertySheetPage
protected org.eclipse.jface.viewers.TreeViewer selectionViewer
protected org.eclipse.jface.viewers.TreeViewer instanceViewer
protected org.eclipse.jface.viewers.TreeViewer parentViewer
protected org.eclipse.jface.viewers.TreeViewer treeViewer
protected org.eclipse.jface.viewers.ListViewer listViewer
protected org.eclipse.jface.viewers.TableViewer tableViewer
protected org.eclipse.jface.viewers.TreeViewer treeViewerWithColumns
protected org.eclipse.emf.common.ui.ViewerPane currentViewerPane
protected org.eclipse.jface.viewers.Viewer currentViewer
protected org.eclipse.jface.viewers.ISelectionChangedListener selectionChangedListener
protected java.util.Collection selectionChangedListeners
ISelectionChangedListener
s that are listening to this editor.
protected org.eclipse.jface.viewers.ISelection editorSelection
protected org.eclipse.emf.ecore.resource.Resource currentResource
protected int currentPageID
protected org.eclipse.emf.common.util.URI currentSelectionUri
protected IGotoAObject gotoAObject
protected org.eclipse.ui.IPartListener partListener
protected org.eclipse.core.resources.IResourceChangeListener resourceChangeListener
Constructor Detail |
---|
public CoreEditor()
Method Detail |
---|
protected org.eclipse.emf.ecore.resource.Resource getCurrentResource()
protected void setCurrentResource(org.eclipse.emf.ecore.resource.Resource res)
protected org.eclipse.emf.ecore.resource.ResourceSet getResourceSet()
protected void handleActivate()
protected java.util.Collection getCurrentSelection()
protected void handleChangedResources()
protected boolean handleDirtyConflict()
protected void firePropertyChange(int action)
firePropertyChange
in class org.eclipse.ui.part.WorkbenchPart
public void setSelectionToViewer(java.util.Collection collection)
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
IEditingDomainProvider
interface.
This is important for implementing the static methods of AdapterFactoryEditingDomain
and for supporting CommandAction
.
getEditingDomain
in interface org.eclipse.emf.edit.domain.IEditingDomainProvider
public void setCurrentViewerPane(org.eclipse.emf.common.ui.ViewerPane viewerPane)
public void setCurrentViewer(org.eclipse.jface.viewers.Viewer viewer)
public org.eclipse.jface.viewers.Viewer getViewer()
IViewerProvider
interface.
getViewer
in interface org.eclipse.emf.common.ui.viewer.IViewerProvider
protected void createContextMenuFor(org.eclipse.jface.viewers.StructuredViewer viewer)
public org.eclipse.emf.ecore.resource.Resource createModel()
public void createPages()
createPages
in class org.eclipse.ui.part.MultiPageEditorPart
protected void hideTabs()
protected void pageChange(int pageIndex)
pageChange
in class org.eclipse.ui.part.MultiPageEditorPart
public java.lang.Object getAdapter(java.lang.Class key)
getAdapter
in interface org.eclipse.core.runtime.IAdaptable
getAdapter
in class org.eclipse.ui.part.MultiPageEditorPart
public IGotoAObject getGotoAObject()
public org.eclipse.jface.viewers.TreeViewer getContentOutlineViewer()
public org.eclipse.ui.views.contentoutline.IContentOutlinePage getContentOutlinePage()
public org.eclipse.ui.views.properties.IPropertySheetPage getPropertySheetPage()
public void handleContentOutlineSelection(org.eclipse.jface.viewers.ISelection selection)
public boolean isDirty()
IEditorPart
and simply tests the command stack.
isDirty
in interface org.eclipse.ui.ISaveablePart
isDirty
in class org.eclipse.ui.part.MultiPageEditorPart
public void doSave(org.eclipse.core.runtime.IProgressMonitor progressMonitor)
IEditorPart
and simply saves the model file.
doSave
in interface org.eclipse.ui.ISaveablePart
doSave
in class org.eclipse.ui.part.EditorPart
protected boolean isPersisted(org.eclipse.emf.ecore.resource.Resource resource)
public boolean isSaveAsAllowed()
isSaveAsAllowed
in interface org.eclipse.ui.ISaveablePart
isSaveAsAllowed
in class org.eclipse.ui.part.EditorPart
public void doSaveAs()
doSaveAs
in interface org.eclipse.ui.ISaveablePart
doSaveAs
in class org.eclipse.ui.part.EditorPart
protected void doSaveAs(org.eclipse.emf.common.util.URI uri, org.eclipse.ui.IEditorInput editorInput)
public void gotoMarker(org.eclipse.core.resources.IMarker marker)
gotoMarker
in interface org.eclipse.ui.ide.IGotoMarker
public void gotoAObject(AObject obj)
obj
- protected void markInNavigationHistory()
public org.eclipse.ui.INavigationLocation createEmptyNavigationLocation()
createEmptyNavigationLocation
in interface org.eclipse.ui.INavigationLocationProvider
public org.eclipse.ui.INavigationLocation createNavigationLocation()
createNavigationLocation
in interface org.eclipse.ui.INavigationLocationProvider
public void init(org.eclipse.ui.IEditorSite site, org.eclipse.ui.IEditorInput editorInput)
init
in interface org.eclipse.ui.IEditorPart
init
in class org.eclipse.ui.part.MultiPageEditorPart
public void setFocus()
setFocus
in interface org.eclipse.ui.IWorkbenchPart
setFocus
in class org.eclipse.ui.part.MultiPageEditorPart
public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
ISelectionProvider
.
addSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
ISelectionProvider
.
removeSelectionChangedListener
in interface org.eclipse.jface.viewers.ISelectionProvider
public org.eclipse.jface.viewers.ISelection getSelection()
ISelectionProvider
to return this editor's overall selection.
getSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void setSelection(org.eclipse.jface.viewers.ISelection selection)
ISelectionProvider
to set this editor's overall selection.
Calling this result will notify the listeners.
added currentSelectionURI tracking
setSelection
in interface org.eclipse.jface.viewers.ISelectionProvider
public void setStatusLineManager(org.eclipse.jface.viewers.ISelection selection)
public void menuAboutToShow(org.eclipse.jface.action.IMenuManager menuManager)
IMenuListener
to help fill the context menus with contributions from the Edit menu.
menuAboutToShow
in interface org.eclipse.jface.action.IMenuListener
public org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor getActionBarContributor()
public org.eclipse.ui.IActionBars getActionBars()
public org.eclipse.emf.common.notify.AdapterFactory getAdapterFactory()
public void dispose()
dispose
in interface org.eclipse.ui.IWorkbenchPart
dispose
in class org.eclipse.ui.part.MultiPageEditorPart
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |