blob: 8bca5383ecfacd8323874dcb431cff2b0a936419 [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>User Interface</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="OCLExamplesforUML.html" title="OCL Constraint Examples for UML (using Papyrus)">
<link rel="next" href="StandardLibrary.html" title="The OCL Standard Library">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">User Interface</h1>
<div class="section" title="User Interface">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="UserInterface"></a>User Interface</h2>
</div>
</div>
</div>
<p>The user interface comprises</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<a class="link" href="Editors.html" title="Editors">Editors</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="InteractiveOCL.html" title="Console">Console</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="Debugger.html" title="Debugger (new in Luna)">Debugger</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="ValidityView.html" title="Validity View (new in Luna)">Validity View</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#PreferencePages" title="Workspace Preference Pages">Workspace Preference Pages</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#PropertyPages" title="Project Property Pages">Project Property Pages</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="CompleteOCLTutorial.html#LoadCompleteOCLResource" title="OCL->Load Document Menu Action">OCL-&gt;Load Document Menu Action</a>
</p>
</li>
</ul>
</div>
<div class="section" title="Project Property Pages">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="PropertyPages"></a>Project Property Pages</h3>
</div>
</div>
</div>
<p>The Project Property Pages are accessible by invoking
<span class="bold"><strong>Properties</strong></span> from the right button context menu of a project.
</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1800-property-pages.png"></div>
<p>
</p>
<p>In principle, it is possible to specify project-specific settings, however in practice is not often possible for application code to determine the prevailing project. Project-specific properties are therefore often ignored and may be removed in a future release.</p>
<p>The Property pages are:</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#OverallOptions" title="Overall Options">Overall Options</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#OCLinEcoreOptions" title="OCLinEcore Options">OCLinEcore editor Options</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#EcoreUMLOptions" title="Ecore and UML Options">Options applicable to the Ecore and UML bindings</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#UMLOptions" title="UML Options">Options applicable to just the UML bindings</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#ModelRegistry" title="Model Registry">The Model Registry</a>
</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Workspace Preference Pages">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="PreferencePages"></a>Workspace Preference Pages</h3>
</div>
</div>
</div>
<p>The Workspace Preference Pages are accessible by invoking
<span class="bold"><strong>Preferences</strong></span> from the
<span class="bold"><strong>Window</strong></span> menu on the toolbar.
</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1800-preference-pages.png"></div>
<p>
</p>
<p>The Preference pages are:</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#OverallOptions" title="Overall Options">Overall Options</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#OCLinEcoreOptions" title="OCLinEcore Options">OCLinEcore editor Options</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#EcoreUMLOptions" title="Ecore and UML Options">Options applicable to the Ecore and UML bindings</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#UMLOptions" title="UML Options">Options applicable to just the UML bindings</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#SyntaxColoring" title="Syntax Coloring">Editor Syntax Coloring</a>
</p>
</li>
<li class="listitem">
<p>
<a class="link" href="UserInterface.html#EditorTemplates" title="Editor Templates">Editor Templates</a>
</p>
</li>
</ul>
</div>
</div>
<div class="section" title="Overall Options">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="OverallOptions"></a>Overall Options</h3>
</div>
</div>
</div>
<p>The two overall options are independent of the Ecore/UML/Pivot bindings.</p>
<div class="section" title="Default Delegation Mode">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="DefaultDelegationMode"></a>Default Delegation Mode</h4>
</div>
</div>
</div>
<p>The Eclipse OCL project provides two execution engines which may be used to support EMF Delegates.</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1810-default-delegation-mode.png"></div>
<p>
</p>
<div class="section" title="http://www.eclipse.org/emf/2002/Ecore/OCL/LPG">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="LPGDelegation"></a>http://www.eclipse.org/emf/2002/Ecore/OCL/LPG</h5>
</div>
</div>
</div>
<p>EMF Delegate annotations referencing the
<code class="code">http://www.eclipse.org/emf/2002/Ecore/OCL/LPG</code> URI are serviced by the classic evaluator that uses the LPG parser.
</p>
<p>This URI was introduced in the Indigo release.</p>
</div>
<div class="section" title="http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="PivotDelegation"></a>http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</h5>
</div>
</div>
</div>
<p>EMF Delegate annotations referencing the
<code class="code">http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</code> URI are serviced by the new experimental evaluator that uses the UML-aligned Pivot model.
</p>
<p>This URI was introduced in the Indigo release and was imposed by the Indigo OCLinEcore editor.</p>
</div>
<div class="section" title="http://www.eclipse.org/emf/2002/Ecore/OCL">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="DefaultDelegation"></a>http://www.eclipse.org/emf/2002/Ecore/OCL</h5>
</div>
</div>
</div>
<p>EMF Delegate annotations referencing the
<code class="code">http://www.eclipse.org/emf/2002/Ecore/OCL</code> URI are serviced by the evaluator selected on the preference page by the
<a class="link" href="UserInterface.html#DefaultDelegationMode" title="Default Delegation Mode">Default Delegation Mode</a>.
</p>
<p>This URI was introduced in the Helios release and was imposed by the Helios OCLinEcore editor.</p>
<p>Use of an Indigo or Juno editor converts the URI to use the Pivot evaluator.</p>
<p>In Kepler, a prevailing URI in the input file is preserved, unless changed by the context menu setting. If no prevailing URI exists a default is determined by an OCLinEcore preference setting that defaults to the Pivot evaluator.</p>
</div>
</div>
<div class="section" title="Code Generation Mode">
<div class="titlepage">
<div>
<div>
<h4 class="title">
<a name="CodeGenerationMode"></a>Code Generation Mode</h4>
</div>
</div>
</div>
<p>Juno introduced an experimental ability to replace the delegated interpreted execution of OCL by direct execution of compiled Java code. This facility has been substantially improved and tested for the Kepler release.</p>
<p>Optimisations for Luna included inlining the bodies directly into the EMF Impl classes. </p>
<p>Mars has useful fixes and benefits from safe navigation analyses.</p>
<p>Further optimisations are scheduled for future releases.</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1810-code-generation-mode.png"></div>
<p>
</p>
<p>This option may be selected to change the realization of OCL option.</p>
<div class="section" title="Delegate for interpretation at run-time">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="CodeGenerationMode-DELEGATED"></a>Delegate for interpretation at run-time</h5>
</div>
</div>
</div>
<p>Selecting the default delegation mode retains the Helios and Indigo functionality whereby
<span class="bold"><strong>genmodel</strong></span> generates Java code that encodes the OCL expressions as text strings. Each expression is lazily compiled at run-time with the result being cached to reduce overheads for repeated execution.
</p>
</div>
<div class="section" title="Generate Java code in xxxBodies classes">
<div class="titlepage">
<div>
<div>
<h5 class="title">
<a name="CodeGenerationMode-GENERATED"></a>Generate Java code in xxxBodies classes</h5>
</div>
</div>
</div>
<p>Selecting Java code generation causes
<span class="bold"><strong>genmodel</strong></span> to run Xtend templates that generate
</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>a
<span class="emphasis"><em>Package</em></span> Tables.java file
</p>
</li>
<li class="listitem">
<p>inline OCL implementations within the
<span class="emphasis"><em>Class</em></span> Impl.java files
</p>
</li>
</ul>
</div>
<p>The tables file contains an optimised model representation allowing polymorphic operations to be dispatched in constant time.</p>
<p>The implementation files contain Java code corresponding to each OCL expression defining operation bodies or property initializers.</p>
<p>Disclaimer: the generated code is experimental has yet to be optimized and so is only about five times faster than the interpreted execution. </p>
</div>
</div>
</div>
<div class="section" title="Ecore and UML Options">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="EcoreUMLOptions"></a>Ecore and UML Options</h3>
</div>
</div>
</div>
<p>The options for the Ecore and UML bindings.</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1820-ecore-uml-options.png"></div>
<p>
</p>
</div>
<div class="section" title="UML Options">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="UMLOptions"></a>UML Options</h3>
</div>
</div>
</div>
<p>The options for the UML binding.</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1830-uml-options.png"></div>
<p>
</p>
</div>
<div class="section" title="Model Registry">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ModelRegistry"></a>Model Registry</h3>
</div>
</div>
</div>
<p>The Model Registry is now deprecated.</p>
</div>
<div class="section" title="Syntax Coloring">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="SyntaxColoring"></a>Syntax Coloring</h3>
</div>
</div>
</div>
<p>The standard Xtext syntax coloring facilities are provided for each of the OCL editors.</p>
</div>
<div class="section" title="Editor Templates">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="EditorTemplates"></a>Editor Templates</h3>
</div>
</div>
</div>
<p>The standard Xtext editor template facilities are provided for each of the OCL editors.</p>
</div>
<div class="section" title="OCLinEcore Options">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="OCLinEcoreOptions"></a>OCLinEcore Options</h3>
</div>
</div>
</div>
<p>The options for the OCLinEcore editor.</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1870-oclinecore-options.png"></div>
<p>
</p>
<p>OCL embedded in Ecore can be executed with either the Classic evaluator or the new Pivot evaluator depending on the URI used to define the embedded EAnnotations. This preference determines the URI written to Ecore files when no URI was previously in use.</p>
<p>Selecting
<code class="code">http://www.eclipse.org/emf/2002/Ecore/OCL</code> makes no choice and so defers to the user&rsquo;s
<a class="link" href="UserInterface.html#DefaultDelegation" title="http://www.eclipse.org/emf/2002/Ecore/OCL">run-time delegation choice</a>.
</p>
<p>Selecting
<code class="code">http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot</code> is recommended since the OCLinEcore editor and Pivot evaluator both use the Xtext parser. This should avoid problems whereby not all facilities of the new Pivot grammar are supported by the Classic grammic or LPG evaluator.
</p>
<p>Selecting
<code class="code">http://www.eclipse.org/emf/2002/Ecore/OCL/LPG</code> may be appropriate if evaluation using the classic LPG evaluator is important.
</p>
</div>
</div>
</body>
</html>