blob: 5f7ad65ec97ce72913b8ce240473346c8bf8ac9a [file] [log] [blame]
<html>
<head>
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
<link rel="STYLESHEET" href="../book.css" charset="ISO-8859-1" type="text/css">
<title>Usability features of the editor </title>
</head>
<body lang=EN-US>
<h1>Usability features of the editor</h1>
<h2>Architecture</h2>
<p>The main motivation behind the GUI improvements was adding
support for EMF Generics to the Feb 2005 release of Emfatic (authored by Christopher J Daly).
<br>
The conversion between <tt>.ecore</tt> and <tt>.emf</tt> now understands them, as a consequence Emfatic
now requires EMF 2.3 or higher. Examples of new productions in the grammar appear
at the end of this document, the new grammar is backwards compatible. </p>
<p>After each keystroke the document is parsed, a CST is built and
(if possible) an AST too. A bidirectional multimap keeps the correspondence
between textual representation (CST nodes) and AST node. The performance impact
is acceptable. Functionality such as "Mark Occurrences" do not resort to exploring
the textual document. Instead, the (offset, length) pair is used to get a CST
node, from which an AST node can be found, making for robust navigation. </p>
<p>The availability of CST, AST and their bridging will likely
simplify the introduction of new functionality. </p>
<h2>New GUI features</h2>
<table border=1 cellspacing=0 cellpadding=0>
<tr style='page-break-inside:avoid'>
<td width=311 valign=top style='width:233.1pt;border:solid windowtext 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal><img border=0 width=278 height=269
src="GUIFeatures-Dateien/image001.gif"></p>
</td>
<td width=223 colspan=2 valign=top style='width:167.3pt;border:solid windowtext 1.0pt;
border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal>The Outline view now displays the same elements as the
Sample Ecore Editor, toolbar actions are available for hiding/showing
annotations, attributes, references, operations. </p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=311 valign=top style='width:233.1pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal><img border=0 width=319 height=208
src="GUIFeatures-Dateien/image002.gif"></p>
<p class=MsoNormal>&nbsp;</p>
</td>
<td width=223 colspan=2 valign=top style='width:167.3pt;border-top:none;
border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal>Mark occurrences highlights usages of the same
EClassifier, range indication on the vertical bar spans the EClassifier
declaration.</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>&nbsp;</p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=311 valign=top style='width:233.1pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><img border=0 width=266 height=103
src="GUIFeatures-Dateien/image003.gif"></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal><img border=0 width=310 height=158
src="GUIFeatures-Dateien/image004.gif"></p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>&nbsp;</p>
<p class=MsoNormal>&nbsp;</p>
</td>
<td width=223 colspan=2 valign=top style='width:167.3pt;border-top:none;
border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt'>
<p class=MsoNormal>Folding is supported, with an annotation hover for
collapsed regions. </p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p>Problem and warning markers (with squigglies) are updated after
each keystroke. </p>
<p class=MsoNormal align=center style='text-align:center'><img border=0
width=576 height=304 src="GUIFeatures-Dateien/image005.jpg"></p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p>Attempting to generate an .emf for an .ecore triggers an
EcoreValidation. Errors and warnings are shown in the Problems view, generation
is still allowed if there are only warnings. </p>
<p class=MsoNormal align=center style='text-align:center'><img border=0
width=543 height=370 src="GUIFeatures-Dateien/image006.gif"></p>
<p class=MsoNormal align=center style='text-align:center'>&nbsp;</p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=432 colspan=2 valign=top style='width:323.75pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p><img border=0 width=448 height=155
src="GUIFeatures-Dateien/image007.gif"></p>
</td>
<td width=102 valign=top style='width:76.65pt;border-top:none;border-left:
none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt'>
<p>The selected outline node follows the cursor position in
the text </p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p><img border=0 width=447 height=93
src="GUIFeatures-Dateien/image008.gif"></p>
<p>Navigable hyperlinks (from usages of classifiers and type
variables to their declarations)</p>
<p>Hyperlinks are very handy for example to follow an
eOpposite to its declaration (alternatively, letting the mouse cursor rest over
an eOpposite displays its definition in a text hover, see below)</p>
<p>Open declaration is also supported, i.e. pressing F3 (or
whatever key binding is in effect for it) moves the cursor to the
declaration.</p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p>A <i>File &gt; New &gt; Other …</i> wizard is available,
which initializes the just created .emf file to a syntactically correct
state: </p>
<p><span style='font-size:10.0pt'>&nbsp;</span></p>
<p><span style='font-size:10.0pt;font-family:"Courier New";color:black'>@namespace(</span></p>
<p style='text-autospace:none'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>  uri=</span><b>
<span style='font-size:10.0pt;font-family:"Courier New";color:navy'>&quot;http://a.b.c/x/y/Z&quot;</span></b>
<span style='font-size:10.0pt;font-family:"Courier New";color:black'>, </span></p>
<p class=MsoNormal style='text-autospace:none'><span lang=DE
style='font-size:10.0pt;font-family:"Courier New";color:black'>  prefix=</span><b><span
style='font-size:10.0pt;font-family:"Courier New";color:navy'>&quot;p&quot;</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'>)</span></p>
<p style='text-autospace:none'><b><span style='font-size:10.0pt;font-family:"Courier New";color:navy'>package</span></b><span
style='font-size:10.0pt;font-family:"Courier New";color:black'> top;</span></p>
<p align=center style='text-align:center'><img border=0
width=297 height=371 src="GUIFeatures-Dateien/image009.jpg"></p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=534 colspan=3 valign=top style='width:400.4pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p>Hovers for usages of classifiers, type parameter
variables, and eOpposite references: the definition is shown. </p>
<p class=MsoNormal align=center style='text-align:center'><img border=0
width=495 height=241 src="GUIFeatures-Dateien/image010.gif"></p>
</td>
</tr>
<tr height=0>
<td width=426 style='border:none'></td>
<td width=121 style='border:none'></td>
<td width=102 style='border:none'></td>
</tr>
</table>
<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
style='border-collapse:collapse;border:none'>
<tr style='page-break-inside:avoid'>
<td width=175 valign=top style='width:131.4pt;border:solid windowtext 1.0pt;
padding:0cm 5.4pt 0cm 5.4pt'>
<p><img border=0 width=146 height=82
src="GUIFeatures-Dateien/image011.gif"></p>
</td>
<td width=415 valign=top style='width:311.4pt;border:solid windowtext 1.0pt;
border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p>AutoEdits</p>
<p><b>SmartBrace</b>: typing an opening brace automatically
adds its closing brace and leaves the cursor indented on its own line (end
result shown left) </p>
<p>Besides that strategy the usual ones: </p>
<p class=MsoNormal style='margin-left:24.0pt;text-indent:-18.0pt'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>DefaultIndentLine</p>
<p class=MsoNormal style='margin-left:24.0pt;text-indent:-18.0pt'>-<span
style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>Closing quote for opening quote</p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=590 colspan=2 valign=top style='width:442.8pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p>Preference pages, to control AutoEdits and templates (see
example below)</p>
<p class=MsoNormal align=center style='text-align:center'><img border=0
width=466 height=269 src="GUIFeatures-Dateien/image012.jpg"></p>
</td>
</tr>
<tr style='page-break-inside:avoid'>
<td width=590 colspan=2 valign=top style='width:442.8pt;border:solid windowtext 1.0pt;
border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
<p>A template for each kind of annotation saves typing. In
the example, the template definition for adding OCL invariants is shown (the
error marker is transient, once the template is inserted it disappears) </p>
<p class=MsoNormal align=center style='text-align:center'><img border=0
width=576 height=155 src="GUIFeatures-Dateien/image013.gif"></p>
<p>after choosing the template above</p>
<p align=center style='text-align:center'><img border=0
width=438 height=135 src="GUIFeatures-Dateien/image014.gif"></p>
</td>
</tr>
</table>
<h2><a name="_Toc159305515">Show in EMF Type Hierarchy</a></h2>
<p>“Show in EMF Type Hierarchy” can be activated from the
editor and from the outline view</p>
<p align=center style='text-align:center'><img border=0
width=391 height=163 src="GUIFeatures-Dateien/image015.jpg"></p>
<p>The supertype and subtype relationships can be followed,
with a list of (inherited) class members displayed on the lower pane.
Double-clicking on any of these elements navigates in the editor to its
declaration. </p>
<p align=center style='text-align:center'><img border=0
width=365 height=506 src="GUIFeatures-Dateien/image016.gif"></p>
</div>
</body>
</html>