de.uka.ipd.sdq.context.computed_allocation.presentation
Class ComputedAllocationEditor

java.lang.Object
  extended by MultiPageEditorPart
      extended by de.uka.ipd.sdq.context.computed_allocation.presentation.ComputedAllocationEditor

public class ComputedAllocationEditor
extends MultiPageEditorPart

This is an example of a ComputedAllocation model editor.


Nested Class Summary
 class ComputedAllocationEditor.ReverseAdapterFactoryContentProvider
           
 
Field Summary
protected  ComposedAdapterFactory adapterFactory
          This is the one adapter factory used for providing views of the model.
protected  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.
static String copyright
           
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.
protected  ViewerPane currentViewerPane
          This keeps track of the active viewer pane, in the book.
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.
protected  ListViewer listViewer
          This shows how a list view works.
protected  MarkerHelper markerHelper
          The MarkerHelper is responsible for creating workspace resource markers presented in Eclipse's Problems View.
protected  TreeViewer parentViewer
          This inverts the roll of parent and child in the content provider and show parents as a tree.
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  Collection<Resource> removedResources
          Resources that have been removed since last activation.
protected  IResourceChangeListener resourceChangeListener
          This listens for workspace changes.
protected  Map<Resource,Diagnostic> resourceToDiagnosticMap
          Map to store the diagnostic associated with a resource.
protected  Collection<Resource> savedResources
          Resources that have been saved.
protected  ISelectionChangedListener selectionChangedListener
          This listens to which ever viewer is active.
protected  Collection<ISelectionChangedListener> selectionChangedListeners
          This keeps track of all the org.eclipse.jface.viewers.ISelectionChangedListeners that are listening to this editor.
protected  TreeViewer selectionViewer
          This is the viewer that shadows the selection in the content outline.
protected  TableViewer tableViewer
          This shows how a table view works.
protected  TreeViewer treeViewer
          This shows how a tree view works.
protected  TreeViewer treeViewerWithColumns
          This shows how a tree view with columns works.
protected  boolean updateProblemIndication
          Controls whether the problem indication should be updated.
 
Constructor Summary
ComputedAllocationEditor()
          This creates a model editor.
 
Method Summary
 void addSelectionChangedListener(ISelectionChangedListener listener)
          This implements org.eclipse.jface.viewers.ISelectionProvider.
 Diagnostic 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 createContextMenuFor(StructuredViewer viewer)
          This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
 void createModel()
          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()
           
 Object getAdapter(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 org.eclipse.jface.viewers.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 org.eclipse.jface.action.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 org.eclipse.jface.viewers.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 setCurrentViewerPane(ViewerPane viewerPane)
           
 void setFocus()
           
 void setSelection(ISelection selection)
          This implements org.eclipse.jface.viewers.ISelectionProvider 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 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final String copyright

See Also:
Constant Field Values

editingDomain

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


adapterFactory

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


contentOutlinePage

protected IContentOutlinePage contentOutlinePage
This is the content outline page.


contentOutlineStatusLineManager

protected IStatusLineManager contentOutlineStatusLineManager
This is a kludge...


contentOutlineViewer

protected TreeViewer contentOutlineViewer
This is the content outline page's viewer.


propertySheetPage

protected PropertySheetPage propertySheetPage
This is the property sheet page.


selectionViewer

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


parentViewer

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


treeViewer

protected TreeViewer treeViewer
This shows how a tree view works.


listViewer

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


tableViewer

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


treeViewerWithColumns

protected TreeViewer treeViewerWithColumns
This shows how a tree view with columns works.


currentViewerPane

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


currentViewer

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.


selectionChangedListener

protected ISelectionChangedListener selectionChangedListener
This listens to which ever viewer is active.


selectionChangedListeners

protected Collection<ISelectionChangedListener> selectionChangedListeners
This keeps track of all the org.eclipse.jface.viewers.ISelectionChangedListeners that are listening to this editor.


editorSelection

protected ISelection editorSelection
This keeps track of the selection of the editor as a whole.


markerHelper

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


partListener

protected IPartListener partListener
This listens for when the outline becomes active


removedResources

protected Collection<Resource> removedResources
Resources that have been removed since last activation.


changedResources

protected Collection<Resource> changedResources
Resources that have been changed since last activation.


savedResources

protected Collection<Resource> savedResources
Resources that have been saved.


resourceToDiagnosticMap

protected Map<Resource,Diagnostic> resourceToDiagnosticMap
Map to store the diagnostic associated with a resource.


updateProblemIndication

protected boolean updateProblemIndication
Controls whether the problem indication should be updated.


problemIndicationAdapter

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


resourceChangeListener

protected IResourceChangeListener resourceChangeListener
This listens for workspace changes.

Constructor Detail

ComputedAllocationEditor

public ComputedAllocationEditor()
This creates a model editor.

Method Detail

handleActivate

protected void handleActivate()
Handles activation of the editor or it's associated views.


handleChangedResources

protected void handleChangedResources()
Handles what to do with changed resources on activation.


updateProblemIndication

protected void updateProblemIndication()
Updates the problems indication with the information described in the specified diagnostic.


handleDirtyConflict

protected boolean handleDirtyConflict()
Shows a dialog that asks if conflicting changes should be discarded.


initializeEditingDomain

protected void initializeEditingDomain()
This sets up the editing domain for the model editor.


firePropertyChange

protected void firePropertyChange(int action)
This is here for the listener to be able to call it.


setSelectionToViewer

public void setSelectionToViewer(Collection<?> collection)
This sets the selection into whichever viewer is active.


getEditingDomain

public EditingDomain 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.


setCurrentViewerPane

public void setCurrentViewerPane(ViewerPane viewerPane)


setCurrentViewer

public 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.


getViewer

public Viewer getViewer()
This returns the viewer as required by the IViewerProvider interface.


createContextMenuFor

protected void createContextMenuFor(StructuredViewer viewer)
This creates a context menu for the viewer and adds a listener as well registering the menu for extension.


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 Diagnostic analyzeResourceProblems(Resource resource,
                                          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.


hideTabs

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


showTabs

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


pageChange

protected void pageChange(int pageIndex)
This is used to track the active viewer.


getAdapter

public Object getAdapter(Class key)
This is how the framework determines which interfaces we implement.


getContentOutlinePage

public IContentOutlinePage getContentOutlinePage()
This accesses a cached version of the content outliner.


getPropertySheetPage

public IPropertySheetPage getPropertySheetPage()
This accesses a cached version of the property sheet.


handleContentOutlineSelection

public void handleContentOutlineSelection(ISelection selection)
This deals with how we want selection in the outliner to affect the other views.


isDirty

public boolean isDirty()
This is for implementing IEditorPart and simply tests the command stack.


doSave

public void doSave(IProgressMonitor progressMonitor)
This is for implementing IEditorPart and simply saves the model file.


isPersisted

protected boolean isPersisted(Resource resource)
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.


isSaveAsAllowed

public boolean isSaveAsAllowed()
This always returns true because it is not currently supported.


doSaveAs

public void doSaveAs()
This also changes the editor's input.


doSaveAs

protected void doSaveAs(URI uri,
                        IEditorInput editorInput)


gotoMarker

public void gotoMarker(IMarker marker)


init

public void init(IEditorSite site,
                 IEditorInput editorInput)
This is called during startup.


setFocus

public void setFocus()


addSelectionChangedListener

public void addSelectionChangedListener(ISelectionChangedListener listener)
This implements org.eclipse.jface.viewers.ISelectionProvider.


removeSelectionChangedListener

public void removeSelectionChangedListener(ISelectionChangedListener listener)
This implements org.eclipse.jface.viewers.ISelectionProvider.


getSelection

public ISelection getSelection()
This implements org.eclipse.jface.viewers.ISelectionProvider to return this editor's overall selection.


setSelection

public void setSelection(ISelection selection)
This implements org.eclipse.jface.viewers.ISelectionProvider to set this editor's overall selection. Calling this result will notify the listeners.


setStatusLineManager

public void setStatusLineManager(ISelection selection)


menuAboutToShow

public void menuAboutToShow(IMenuManager menuManager)
This implements org.eclipse.jface.action.IMenuListener to help fill the context menus with contributions from the Edit menu.


getActionBarContributor

public EditingDomainActionBarContributor getActionBarContributor()


getActionBars

public IActionBars getActionBars()


getAdapterFactory

public AdapterFactory getAdapterFactory()


dispose

public void dispose()


showOutlineView

protected boolean showOutlineView()
Returns whether the outline view should be presented to the user.