modesteditor.core
Class ModestContentOutlinePage

java.lang.Object
  extended by org.eclipse.ui.part.Page
      extended by org.eclipse.ui.views.contentoutline.ContentOutlinePage
          extended by modesteditor.core.ModestContentOutlinePage
All Implemented Interfaces:
IModestSimulationListener, org.eclipse.jface.viewers.ISelectionChangedListener, org.eclipse.jface.viewers.ISelectionProvider, org.eclipse.ui.part.IPage, org.eclipse.ui.part.IPageBookViewPage, org.eclipse.ui.views.contentoutline.IContentOutlinePage

public class ModestContentOutlinePage
extends org.eclipse.ui.views.contentoutline.ContentOutlinePage
implements IModestSimulationListener

The page that is shown in the Outline view. It's only responsible for managing the internal tree viewer, which is what actually displays the tree of the program's bindings. We pass the tree viewer only the ModestSimulation as input, and it finds out the tree structure using the ModestContentProvider and ModestLabelProvider.

See http://www.eclipse.org/articles/treeviewer-cg/TreeViewerArticle.htm for a good explanation of how this works.


Constructor Summary
ModestContentOutlinePage(ModestEditor editor)
          Creates a new outline page for the given editor.
 
Method Summary
 void createControl(org.eclipse.swt.widgets.Composite parent)
          Sets up the internal tree viewer to use MoDeST's content and label providers, to inform this page when the user selects a model, and to display the models in the editor's program.
 void deselect()
          Deselects everything selected in the tree.
 void select(Model sel)
          Selects the given model in the tree.
 void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
          When the user selects a model in the tree, selects the corresponding identifier in the editor.
 void simulationChanged(ModestSimulation sim)
          Called when the program is updated.
 
Methods inherited from class org.eclipse.ui.views.contentoutline.ContentOutlinePage
addSelectionChangedListener, fireSelectionChanged, getControl, getSelection, getTreeViewer, init, removeSelectionChangedListener, setFocus, setSelection
 
Methods inherited from class org.eclipse.ui.part.Page
dispose, getSite, makeContributions, setActionBars
 
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.part.IPage
dispose, setActionBars
 

Constructor Detail

ModestContentOutlinePage

public ModestContentOutlinePage(ModestEditor editor)
Creates a new outline page for the given editor.

Method Detail

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Sets up the internal tree viewer to use MoDeST's content and label providers, to inform this page when the user selects a model, and to display the models in the editor's program.

Specified by:
createControl in interface org.eclipse.ui.part.IPage
Overrides:
createControl in class org.eclipse.ui.views.contentoutline.ContentOutlinePage

simulationChanged

public void simulationChanged(ModestSimulation sim)
Called when the program is updated. Updates the outline.

Specified by:
simulationChanged in interface IModestSimulationListener

selectionChanged

public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
When the user selects a model in the tree, selects the corresponding identifier in the editor.

Specified by:
selectionChanged in interface org.eclipse.jface.viewers.ISelectionChangedListener
Overrides:
selectionChanged in class org.eclipse.ui.views.contentoutline.ContentOutlinePage

select

public void select(Model sel)
Selects the given model in the tree. Prevents selection change events so that selectionChanged() doesn't get called, which would create an infinite loop of events.


deselect

public void deselect()
Deselects everything selected in the tree.