Classes | Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Member Functions

de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor Class Reference

List of all members.

Classes

class  ReverseAdapterFactoryContentProvider

Public Member Functions

void addSelectionChangedListener (ISelectionChangedListener listener)
Diagnostic analyzeResourceProblems (Resource resource, Exception exception)
 AutosarEditor ()
void createModel ()
void createPages ()
void dispose ()
void doSave (IProgressMonitor progressMonitor)
void doSaveAs ()
EditingDomainActionBarContributor getActionBarContributor ()
IActionBars getActionBars ()
Object getAdapter (Class key)
AdapterFactory getAdapterFactory ()
IContentOutlinePage getContentOutlinePage ()
EditingDomain getEditingDomain ()
IPropertySheetPage getPropertySheetPage ()
ISelection getSelection ()
Viewer getViewer ()
void gotoMarker (IMarker marker)
void handleContentOutlineSelection (ISelection selection)
void init (IEditorSite site, IEditorInput editorInput)
boolean isDirty ()
boolean isSaveAsAllowed ()
void menuAboutToShow (IMenuManager menuManager)
void removeSelectionChangedListener (ISelectionChangedListener listener)
void setCurrentViewer (Viewer viewer)
void setCurrentViewerPane (ViewerPane viewerPane)
void setFocus ()
void setSelection (ISelection selection)
void setSelectionToViewer (Collection<?> collection)
void setStatusLineManager (ISelection selection)

Protected Member Functions

void createContextMenuFor (StructuredViewer viewer)
void doSaveAs (URI uri, IEditorInput editorInput)
void firePropertyChange (int action)
void handleActivate ()
void handleChangedResources ()
boolean handleDirtyConflict ()
void hideTabs ()
void initializeEditingDomain ()
boolean isPersisted (Resource resource)
void pageChange (int pageIndex)
boolean showOutlineView ()
void showTabs ()
void updateProblemIndication ()

Protected Attributes

ComposedAdapterFactory adapterFactory
Collection< Resource > changedResources = new ArrayList<Resource>()
IContentOutlinePage contentOutlinePage
IStatusLineManager contentOutlineStatusLineManager
TreeViewer contentOutlineViewer
Viewer currentViewer
ViewerPane currentViewerPane
AdapterFactoryEditingDomain editingDomain
ISelection editorSelection = StructuredSelection.EMPTY
ListViewer listViewer
MarkerHelper markerHelper = new EditUIMarkerHelper()
TreeViewer parentViewer
IPartListener partListener
EContentAdapter problemIndicationAdapter
PropertySheetPage propertySheetPage
Collection< Resource > removedResources = new ArrayList<Resource>()
IResourceChangeListener resourceChangeListener
Map< Resource, Diagnostic > resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>()
Collection< Resource > savedResources = new ArrayList<Resource>()
ISelectionChangedListener selectionChangedListener
Collection
< ISelectionChangedListener > 
selectionChangedListeners = new ArrayList<ISelectionChangedListener>()
TreeViewer selectionViewer
TableViewer tableViewer
TreeViewer treeViewer
TreeViewer treeViewerWithColumns
boolean updateProblemIndication = true

Static Private Member Functions

static String getString (String key)
static String getString (String key, Object s1)

Detailed Description

This is an example of a Autosar model editor.


Constructor & Destructor Documentation

de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.AutosarEditor (  ) 

This creates a model editor.


Member Function Documentation

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.addSelectionChangedListener ( ISelectionChangedListener  listener  ) 
Diagnostic de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.analyzeResourceProblems ( Resource  resource,
Exception  exception 
)

Returns a diagnostic describing the errors and warnings listed in the resource and the specified exception (if any).

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.createContextMenuFor ( StructuredViewer  viewer  )  [protected]

This creates a context menu for the viewer and adds a listener as well registering the menu for extension.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.createModel (  ) 

This is the method called to load a resource into the editing domain's resource set based on the editor's input.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.createPages (  ) 

This is the method used by the framework to install your own controls.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.dispose (  ) 
void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.doSave ( IProgressMonitor  progressMonitor  ) 

This is for implementing IEditorPart and simply saves the model file.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.doSaveAs (  ) 

This also changes the editor's input.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.doSaveAs ( URI  uri,
IEditorInput  editorInput 
) [protected]
void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.firePropertyChange ( int  action  )  [protected]

This is here for the listener to be able to call it.

EditingDomainActionBarContributor de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getActionBarContributor (  ) 
IActionBars de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getActionBars (  ) 
Object de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getAdapter ( Class  key  ) 

This is how the framework determines which interfaces we implement.

AdapterFactory de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getAdapterFactory (  ) 
IContentOutlinePage de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getContentOutlinePage (  ) 

This accesses a cached version of the content outliner.

EditingDomain de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getEditingDomain (  ) 

This returns the editing domain as required by the IEditingDomainProvider interface. This is important for implementing the static methods of AdapterFactoryEditingDomain and for supporting org.eclipse.emf.edit.ui.action.CommandAction.

IPropertySheetPage de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getPropertySheetPage (  ) 

This accesses a cached version of the property sheet.

ISelection de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getSelection (  ) 

This implements org.eclipse.jface.viewers.ISelectionProvider to return this editor's overall selection.

static String de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getString ( String  key  )  [static, private]

This looks up a string in the plugin's plugin.properties file.

static String de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getString ( String  key,
Object  s1 
) [static, private]

This looks up a string in plugin.properties, making a substitution.

Viewer de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.getViewer (  ) 

This returns the viewer as required by the IViewerProvider interface.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.gotoMarker ( IMarker  marker  ) 
void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.handleActivate (  )  [protected]

Handles activation of the editor or it's associated views.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.handleChangedResources (  )  [protected]

Handles what to do with changed resources on activation.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.handleContentOutlineSelection ( ISelection  selection  ) 

This deals with how we want selection in the outliner to affect the other views.

boolean de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.handleDirtyConflict (  )  [protected]

Shows a dialog that asks if conflicting changes should be discarded.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.hideTabs (  )  [protected]

If there is just one page in the multi-page editor part, this hides the single tab at the bottom.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.init ( IEditorSite  site,
IEditorInput  editorInput 
)

This is called during startup.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.initializeEditingDomain (  )  [protected]

This sets up the editing domain for the model editor.

boolean de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.isDirty (  ) 

This is for implementing IEditorPart and simply tests the command stack.

boolean de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.isPersisted ( Resource  resource  )  [protected]

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.

boolean de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.isSaveAsAllowed (  ) 

This always returns true because it is not currently supported.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.menuAboutToShow ( IMenuManager  menuManager  ) 

This implements org.eclipse.jface.action.IMenuListener to help fill the context menus with contributions from the Edit menu.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.pageChange ( int  pageIndex  )  [protected]

This is used to track the active viewer.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.removeSelectionChangedListener ( ISelectionChangedListener  listener  ) 
void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.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 de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.setCurrentViewerPane ( ViewerPane  viewerPane  ) 
void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.setFocus (  ) 
void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.setSelection ( ISelection  selection  ) 

This implements org.eclipse.jface.viewers.ISelectionProvider to set this editor's overall selection. Calling this result will notify the listeners.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.setSelectionToViewer ( Collection<?>  collection  ) 

This sets the selection into whichever viewer is active.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.setStatusLineManager ( ISelection  selection  ) 
boolean de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.showOutlineView (  )  [protected]

Returns whether the outline view should be presented to the user.

void de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.showTabs (  )  [protected]

If there is more than one page in the multi-page editor part, this shows the tabs at the bottom.

Updates the problems indication with the information described in the specified diagnostic.


Member Data Documentation

This is the one adapter factory used for providing views of the model.

Collection<Resource> de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.changedResources = new ArrayList<Resource>() [protected]

Resources that have been changed since last activation.

This is the content outline page.

This is a kludge...

This is the content outline page's 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.

This keeps track of the active viewer pane, in the book.

This keeps track of the editing domain that is used to track all changes to the model.

ISelection de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.editorSelection = StructuredSelection.EMPTY [protected]

This keeps track of the selection of the editor as a whole.

This shows how a list view works. A list viewer doesn't support icons.

MarkerHelper de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.markerHelper = new EditUIMarkerHelper() [protected]

The MarkerHelper is responsible for creating workspace resource markers presented in Eclipse's Problems View.

This inverts the roll of parent and child in the content provider and show parents as a tree.

This listens for when the outline becomes active

Adapter used to update the problem indication when resources are demanded loaded.

This is the property sheet page.

Collection<Resource> de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.removedResources = new ArrayList<Resource>() [protected]

Resources that have been removed since last activation.

This listens for workspace changes.

Map<Resource, Diagnostic> de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>() [protected]

Map to store the diagnostic associated with a resource.

Collection<Resource> de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.savedResources = new ArrayList<Resource>() [protected]

Resources that have been saved.

This listens to which ever viewer is active.

Collection<ISelectionChangedListener> de.fraunhofer.isst.eastadl.autosar.presentation.AutosarEditor.selectionChangedListeners = new ArrayList<ISelectionChangedListener>() [protected]

This keeps track of all the org.eclipse.jface.viewers.ISelectionChangedListeners that are listening to this editor.

This is the viewer that shadows the selection in the content outline. The parent relation must be correctly defined for this to work.

This shows how a table view works. A table can be used as a list with icons.

This shows how a tree view works.

This shows how a tree view with columns works.

Controls whether the problem indication should be updated.