org.eclipse.mofscript.editor
Class MofScriptContentOutlinePage

java.lang.Object
  extended by org.eclipse.ui.part.Page
      extended by org.eclipse.ui.views.contentoutline.ContentOutlinePage
          extended by org.eclipse.mofscript.editor.MofScriptContentOutlinePage
All Implemented Interfaces:
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 MofScriptContentOutlinePage
extends org.eclipse.ui.views.contentoutline.ContentOutlinePage

A content outliner for MOFScript. Does a crude scan of text lines and detetects the structural patterns

Author:
jol

Nested Class Summary
protected static class MofScriptContentOutlinePage.DeclarationSegment
          A Declaration segment.
protected static class MofScriptContentOutlinePage.ModuleSegment
          A Module Segment.
protected  class MofScriptContentOutlinePage.MofScriptContentProvider
          Divides the editor's document into ten segments and provides elements for them.
protected  class MofScriptContentOutlinePage.MofScriptLabelProvider
          Provides the labels (images) for the different segment types.
protected static class MofScriptContentOutlinePage.PropertySegment
          A property segment
protected static class MofScriptContentOutlinePage.RuleSegment
          A Rule segmener
protected static class MofScriptContentOutlinePage.Segment
          A segment element.
 
Field Summary
protected static org.eclipse.swt.graphics.Image defaultImage
           
protected  org.eclipse.ui.texteditor.IDocumentProvider fDocumentProvider
           
protected  java.lang.Object fInput
           
protected  org.eclipse.ui.texteditor.ITextEditor fTextEditor
           
protected static org.eclipse.swt.graphics.Image moduleImage
           
protected  MofScriptContentOutlinePage.Segment previousSegment
           
protected static org.eclipse.swt.graphics.Image propertyImage
           
protected static org.eclipse.swt.graphics.Image ruleImage
           
 
Constructor Summary
MofScriptContentOutlinePage(org.eclipse.ui.texteditor.IDocumentProvider provider, org.eclipse.ui.texteditor.ITextEditor editor)
          Constructor Creates a content outline page using the given provider and the given editor.
 
Method Summary
 void createControl(org.eclipse.swt.widgets.Composite parent)
          Creates the control for this outliner
 void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
          Event handler for selection changes in the outliner
 void setInput(java.lang.Object input)
          Sets the input object
 void update()
          Updates the outline page.
 
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
 

Field Detail

fInput

protected java.lang.Object fInput

fDocumentProvider

protected org.eclipse.ui.texteditor.IDocumentProvider fDocumentProvider

fTextEditor

protected org.eclipse.ui.texteditor.ITextEditor fTextEditor

moduleImage

protected static org.eclipse.swt.graphics.Image moduleImage

ruleImage

protected static org.eclipse.swt.graphics.Image ruleImage

propertyImage

protected static org.eclipse.swt.graphics.Image propertyImage

defaultImage

protected static org.eclipse.swt.graphics.Image defaultImage

previousSegment

protected MofScriptContentOutlinePage.Segment previousSegment
Constructor Detail

MofScriptContentOutlinePage

public MofScriptContentOutlinePage(org.eclipse.ui.texteditor.IDocumentProvider provider,
                                   org.eclipse.ui.texteditor.ITextEditor editor)
Constructor Creates a content outline page using the given provider and the given editor.

Parameters:
provider - The document provider
editor - The owner editor
Method Detail

setInput

public void setInput(java.lang.Object input)
Sets the input object

Parameters:
input -

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Creates the control for this outliner

Specified by:
createControl in interface org.eclipse.ui.part.IPage
Overrides:
createControl in class org.eclipse.ui.views.contentoutline.ContentOutlinePage
Parameters:
parent -
See Also:
IPage.createControl(org.eclipse.swt.widgets.Composite)

selectionChanged

public void selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent event)
Event handler for selection changes in the outliner

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

update

public void update()
Updates the outline page.