org.eclipse.ocl.examples.xtext.console
Class OCLConsolePage

java.lang.Object
  extended by org.eclipse.ui.part.Page
      extended by org.eclipse.ocl.examples.xtext.console.OCLConsolePage
All Implemented Interfaces:
MetaModelManagerListener, org.eclipse.ui.part.IPage, org.eclipse.ui.part.IPageBookViewPage

public class OCLConsolePage
extends org.eclipse.ui.part.Page
implements MetaModelManagerListener

The page implementing the Interactive OCL console.


Nested Class Summary
protected static class OCLConsolePage.CancelableEvaluationVisitor
          CancelableEvaluationVisitor refines the EvaluationVisitor to poll the monitor for cancellation at a variety of significant evaluation events, such as feature visits and OCLConsolePage.CancelableEvaluationVisitor.createNestedEvaluator().
static class OCLConsolePage.ColorChoices
           
static class OCLConsolePage.InterrogatableContentAssistant
           
static class OCLConsolePage.InterrogatableContentAssistantFactory
           
 
Constructor Summary
protected OCLConsolePage(OCLConsole console)
          Initializes me.
 
Method Summary
protected  void append(java.lang.String text, org.eclipse.swt.graphics.RGB rgb, boolean bold)
          Appends the specified text to the output viewer.
 void createControl(org.eclipse.swt.widgets.Composite parent)
           
 void dispose()
          Extends the inherited method to dispose of additional colour resources.
protected  boolean evaluate(java.lang.String expression)
          Evaluates an OCL expression using the OCL Interpreter's OCLHelper API.
protected  void flushEvents()
           
 org.eclipse.emf.ecore.EObject getContextObject()
           
 org.eclipse.swt.widgets.Control getControl()
           
 org.eclipse.xtext.ui.editor.model.IXtextDocument getDocument(org.eclipse.emf.common.util.URI trimFragment)
           
 BaseDocument getEditorDocument()
           
 java.lang.String getLastOCLExpression()
           
 MetaModelManager getMetaModelManager(org.eclipse.emf.ecore.EObject contextObject)
           
protected  org.eclipse.debug.core.ILaunch internalLaunchDebugger()
           
 void metaModelManagerDisposed(MetaModelManager metaModelManager)
          Respond to disposal of the MetaModelManager by eliminating all further usage.
protected  void refreshSelection(java.lang.Object selected)
           
 void reset()
           
protected  void resetDocument()
           
 void setFocus()
           
 
Methods inherited from class org.eclipse.ui.part.Page
getSite, init, makeContributions, setActionBars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OCLConsolePage

protected OCLConsolePage(OCLConsole console)
Initializes me.

Parameters:
console -
Method Detail

append

protected void append(java.lang.String text,
                      org.eclipse.swt.graphics.RGB rgb,
                      boolean bold)
Appends the specified text to the output viewer.

Parameters:
text - the text to append
rgb - the color to print the text with
bold - whether to print the text bold

createControl

public void createControl(org.eclipse.swt.widgets.Composite parent)
Specified by:
createControl in interface org.eclipse.ui.part.IPage
Specified by:
createControl in class org.eclipse.ui.part.Page

dispose

public void dispose()
Extends the inherited method to dispose of additional colour resources.

Specified by:
dispose in interface org.eclipse.ui.part.IPage
Overrides:
dispose in class org.eclipse.ui.part.Page

evaluate

protected boolean evaluate(java.lang.String expression)
Evaluates an OCL expression using the OCL Interpreter's OCLHelper API.

Parameters:
expression - an OCL expression
Returns:
true on successful evaluation; false if the expression failed to parse or evaluate

flushEvents

protected void flushEvents()

getContextObject

public org.eclipse.emf.ecore.EObject getContextObject()

getControl

public org.eclipse.swt.widgets.Control getControl()
Specified by:
getControl in interface org.eclipse.ui.part.IPage
Specified by:
getControl in class org.eclipse.ui.part.Page

getDocument

public org.eclipse.xtext.ui.editor.model.IXtextDocument getDocument(org.eclipse.emf.common.util.URI trimFragment)

getEditorDocument

public BaseDocument getEditorDocument()

getLastOCLExpression

public java.lang.String getLastOCLExpression()

getMetaModelManager

@NonNull
public MetaModelManager getMetaModelManager(@Nullable
                                                    org.eclipse.emf.ecore.EObject contextObject)

internalLaunchDebugger

protected org.eclipse.debug.core.ILaunch internalLaunchDebugger()

metaModelManagerDisposed

public void metaModelManagerDisposed(@NonNull
                                     MetaModelManager metaModelManager)
Description copied from interface: MetaModelManagerListener
Respond to disposal of the MetaModelManager by eliminating all further usage.

Specified by:
metaModelManagerDisposed in interface MetaModelManagerListener

refreshSelection

protected void refreshSelection(java.lang.Object selected)

reset

public void reset()

resetDocument

protected void resetDocument()

setFocus

public void setFocus()
Specified by:
setFocus in interface org.eclipse.ui.part.IPage
Specified by:
setFocus in class org.eclipse.ui.part.Page