blob: ef9017697ad3653dc6c2b55a3699b18756793d3c [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Console</title>
<link href="book.css" rel="stylesheet" type="text/css">
<meta content="DocBook XSL Stylesheets V1.75.1" name="generator">
<link rel="home" href="index.html" title="OCL Documentation">
<link rel="up" href="UsersGuide.html" title="Users Guide">
<link rel="prev" href="Editors.html" title="Editors">
<link rel="next" href="ValidityView.html" title="Validity View (new in Luna)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Console</h1>
<div class="section" title="Console">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="InteractiveOCL"></a>Console</h2>
</div>
</div>
</div>
<p>There are two interactive OCL consoles that enable OCL expressions to be evaluated on a model.</p>
<p>The classic
<span class="bold"><strong>Interactive Console</strong></span> may be created by invoking
<span class="bold"><strong>OCL-&gt;Show OCL Console</strong></span> from the right button menu of some model editors such as the
<span class="bold"><strong>Sample Ecore Model Editor</strong></span>. Alternatively the
<span class="bold"><strong>Console</strong></span> view may be created by
<span class="bold"><strong>Window-&gt;Show View-&gt;Console</strong></span> followed by selecting
<span class="bold"><strong>Interactive OCL</strong></span> from the
<span class="bold"><strong>Open Console</strong></span> pull-down in the
<span class="bold"><strong>Console</strong></span> View tool bar. See the
<a class="link" href="Tutorials.html#OCLinEcoreTutorial-Console" title="The OCL Console">OCLinEcore Tutorial</a> for detailed step-by-step pictures.
</p>
<p>The Pivot
<span class="bold"><strong>Interactive Xtext Console</strong></span> may be similarly created by
<span class="bold"><strong>OCL-&gt;Show Xtext OCL Console</strong></span> from the menu or
<span class="bold"><strong>Interactive Xtext OCL</strong></span> from the pull-down.
</p>
<p>The two consoles should exhibit similar behaviors, however not all facilities of the classic console have yet been reproduced on the new.</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1520-console.png"></div>
<p>
</p>
<p>The Console, shown in the bottom half of the figure, comprises a combined Title and Tool Bar, Results Panel and Entry Panel.</p>
<div class="section" title="Context Object Selection">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ContextObjectSelection"></a>Context Object Selection</h3>
</div>
</div>
</div>
<p>Expressions are evaluated with respect to a context object
<code class="code">self</code> that has a corresponding metamodel type. This object is defined by selecting any widget whose implementation is adaptable to an EObject. Therefore selecting an EAttribute in the Sample Ecore Editor will make the selected EAttribute
<code class="code">self</code> and EAttribute the metamodel type. In the figure selecting the Member named m1 in the Sample Reflective Ecore Model Editor has made Member the select type of
<code class="code">self</code> and m1 the selected context object. For the Pivot Console there is additional support to use selections from the Outline of an Xtext editor or Variables View of the OCL Debugger as the context object.
</p>
<p>The Pivot Console displays the selected object and type in the Console title.</p>
<p>The classic Console relies on the platform selection mechanism to show the selected object in the overall Eclipse Status display at the bottom left of the workspace window. This display may be lost when the selection is changed to a non-EObject selection.</p>
</div>
<div class="section" title="Editing">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Editing2"></a>Editing</h3>
</div>
</div>
</div>
<p>The bottom panel supports entry and evaluation of a multi-line expression. The expression is evaluated when
<span class="bold"><strong>Enter</strong></span> is entered.
</p>
<p>The classic Console has hand-coded syntax highlighting and context assist that may be activated by typing
<span class="bold"><strong>Ctrl</strong></span> +
<span class="bold"><strong>Space</strong></span>.
</p>
<p>The Pivot Console uses the Xtext EssentialOCL editor and largely auto-generated syntax highlighting, error indications, hover text, quick fixes and context assist that may be activated by typing
<span class="bold"><strong>Ctrl</strong></span> +
<span class="bold"><strong>Space</strong></span>.
</p>
<p>The content assist for the Pivot Console has not yet been customized, so the classic Console content assist is probably more comprehensive, however the Pivot Console shares the same library definitions as the other editors and so is more consistent.</p>
</div>
<div class="section" title="Editor Keys">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="EditorKeys"></a>Editor Keys</h3>
</div>
</div>
</div>
<p>The
<span class="bold"><strong>Page-Up</strong></span> and
<span class="bold"><strong>Page-Down</strong></span> keys may be used to scroll through the history of input commands enabling previous commands to be re-used. Use of the Page keys is necessary since the input is potentially multi-line and so
<span class="bold"><strong>Up</strong></span> and
<span class="bold"><strong>Down</strong></span> navigate over the multiple lines.
</p>
</div>
<div class="section" title="Results">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Results"></a>Results</h3>
</div>
</div>
</div>
<p>The larger middle panel displays the results of each evaluation in a scrolling window.</p>
</div>
<div class="section" title="Tool Bar">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ToolBar"></a>Tool Bar</h3>
</div>
</div>
</div>
<div class="section" title="Ecore/UML binding">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="EcoreUMLbinding"></a>Ecore/UML binding</h4>
</div>
</div>
</div>
<p>The classic Console provides a selection to determine whether the context object has a type defined by an Ecore or UML metamodel. This selection is not required for the Pivot Console which automatically converts Ecore or UML models to Pivot models.</p>
</div>
<div class="section" title="M1/M2">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="M1M2"></a>M1/M2</h4>
</div>
</div>
</div>
<p>The classic Console provides a selection to determine whether the selected metamodel binding is that for objects (M2) or types (M1). This selection is not needed for the Pivot Console since the Pivot metamodel is an instance of itself.</p>
</div>
<div class="section" title="Clear Console">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="ClearConsole"></a>Clear Console</h4>
</div>
</div>
</div>
<p>The standard clear console functionality clears the results pane.</p>
</div>
<div class="section" title="Close Console">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="CloseConsole"></a>Close Console</h4>
</div>
</div>
</div>
<p>The standard close console functionality closes the current console.</p>
</div>
<div class="section" title="Debug">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="Debug"></a>Debug</h4>
</div>
</div>
</div>
<p>Starts the
<a class="link" href="Debugger.html" title="Debugger (new in Luna)">OCL Debugger</a> using the current mouse selection as self and the text in the Console input as the exopression to execute.
</p>
</div>
<div class="section" title="Load/Save an expression">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="LoadSaveanexpression"></a>Load/Save an expression</h4>
</div>
</div>
</div>
<p>The classic Console provides an ability to save and reload edited expressions as XMI files. The XMI is a pragmatic Eclipse Ecore realisation of the OCL specification for which XMI interchange is not realisable.</p>
<p>The Pivot Console provides a similar ability to save and reload edited expressions as XMI files. The XMI is a prototype that might evolve and be adopted by a future version of the OCL specification.
<span class="italic">This functionality has not been properly tested.</span>
</p>
</div>
</div>
</div>
</body>
</html>