blob: 883c6d065be3e31c799fc0b3c963ddca02932f61 [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Editors</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="OCLstdlib.html" title="The OCL Standard Library Language">
<link rel="next" href="NatureAndBuilder.html" title="OCL Nature and Builder Auto-Validation">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<h1 xmlns:l="http://docbook.sourceforge.net/xmlns/l10n/1.0">Editors</h1>
<div class="section" title="Editors">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both">
<a name="Editors"></a>Editors</h2>
</div>
</div>
</div>
<p>The four editors are all generated using
<a class="ulink" href="../../org.eclipse.xtext.doc/contents/xtext.html" target="_new">Xtext</a>, and so exhibit similar behavior to other Eclipse editors.
</p>
<p>The standard facilities are</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>syntax coloring</p>
</li>
<li class="listitem">
<p>folding</p>
</li>
<li class="listitem">
<p>outline view</p>
</li>
<li class="listitem">
<p>hover text</p>
</li>
<li class="listitem">
<p>syntax validation</p>
</li>
<li class="listitem">
<p>semantic validation</p>
</li>
</ul>
</div>
<p>The following facilities have partial functionality</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>go to definition</p>
</li>
<li class="listitem">
<p>content assist</p>
</li>
<li class="listitem">
<p>templates</p>
</li>
<li class="listitem">
<p>quick fixes</p>
</li>
<li class="listitem">
<p>find references</p>
</li>
</ul>
</div>
<p>The following facilities have little or no functionality</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>rename element</p>
</li>
<li class="listitem">
<p>final validation</p>
</li>
</ul>
</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 editors use similar colors to JDT.</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>green for comments</p>
</li>
<li class="listitem">
<p>bold purple for keywords</p>
</li>
<li class="listitem">
<p>grey for numbers</p>
</li>
<li class="listitem">
<p>blue for strings</p>
</li>
</ul>
</div>
<p>Additionally</p>
<div class="itemizedlist">
<ul class="itemizedlist" type="disc">
<li class="listitem">
<p>italics for text referencing a definition</p>
</li>
</ul>
</div>
<p>References for which the name of the definition matches a keyword use italics in the same way as other cross references. Names of a definition matching a keyword use bold purple in the same way as keywords.</p>
<p>The syntax coloring may be changed using the
<span class="bold"><strong>Window-&gt;Preferences-&gt;OCL</strong></span> pages.
</p>
</div>
<div class="section" title="Validation">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="Validation"></a>Validation</h3>
</div>
</div>
</div>
<p>Syntax errors are detected and offending text is underlined with accompanying annotations and problem markers.</p>
<p>If there are no syntax errors, semantic validation is performed with similar feedback of problems. Semantic validation is not performed when there are syntax errors since a single syntax error may provoke many hundreds of semantic errors. These can make the original syntax error difficult to resolve.</p>
<p>The use of the well-formedness rules for a final validation of the Abstract Syntax is only partially implemented,
since correction of the OCL in the OMG specifiucation is still work in progress.</p>
<p>By default, the Xtext nature is not added to projects using OCL editors and so no builder runs in the background creating problem markers for OCL files. This is generally beneficial when you have many files for which the over-enthusiastic rebuilds waste build time, or experimental files for which the many errors clutter the Problem View. </p>
<p>If your OCL is good quality, you may activate the Xtext nature and builder by selecting the project and then invoking
<span class="bold"><strong>Configure-&gt;Add Xtext Nature</strong></span>.
</p>
</div>
<div class="section" title="Hover Text">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="HoverText"></a>Hover Text</h3>
</div>
</div>
</div>
<p>Hover text has been implemented to provide feedback on the usage and type of expression terms. For instance hovering over the size operation in the example below reveals that it is an Operation for the Loan specialization of Collection . </p>
<p>
</p>
<div class="mediaobject">
<img src="images/1510-hovertext.png"></div>
<p>
</p>
<p>(Note that the Class specialization for Loan is incorrectly shown again as an Operation specialization.)</p>
</div>
<div class="section" title="Content Assist">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="ContentAssist"></a>Content Assist</h3>
</div>
</div>
</div>
<p>Typing
<span class="bold"><strong>Ctrl</strong></span> and
<span class="bold"><strong>Space</strong></span> activates the Content Assist pop-up to offer suggestions as to what might be typed to the right of the cursor.
</p>
<p>
</p>
<div class="mediaobject">
<img src="images/1510-contentassist.png"></div>
<p>
</p>
</div>
<div class="section" title="Code Templates">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="CodeTemplates"></a>Code Templates</h3>
</div>
</div>
</div>
<p>Code templates are provided for many of the major constructs and some expression elements.</p>
<p>You may define your own templates. If you would like to contribute them, please raise a Bugzilla.</p>
</div>
<div class="section" title="Open Declaration">
<div class="titlepage">
<div>
<div>
<h3 class="title">
<a name="OpenDeclaration"></a>Open Declaration</h3>
</div>
</div>
</div>
<p>It is possible to navigate to a definition provided an editor is already open for the definition. </p>
</div>
</div>
</body>
</html>