blob: 61d772a534628161b6d31c91e06cbb66a098b7bf [file] [log] [blame]
<md-content layout="column" layout-align="center stretch" class="content">
<ul class="breadcrumb">
<li><a href="#/documentation/1.9.2">1.9.2</a> <span class="divider">/</span></li>
<li><a href="#/documentation/1.9.2/language/overview">Language</a> <span class="divider">/</span></li>
<li><a href="#/documentation/1.9.2/language/widgets">Widgets</a></li>
</ul>
<h2 id="Text">Text</h2>
<h3 id="description">Description</h3>
<p>The text widget is one of the most simple widget in EEF, with this widget your can create a single line or multiline text field in your user interface. On top of the common properties of all widgets (identifier, labelExpression, helpExpression, isEnabledExpression, propertyValidationRules), it has the following properties:</p>
<ul>
<li>valueExpression: The value expression is used to compute the value to set in the text field. This expression must return a string.</li>
<li>editExpression: The edit expression will be executed when the user will type some content in the text field. The current value of the text field will be accessible in a variable named
<code>newValue</code>. The variable
<code>newValue</code> is a
<code>java.lang.String</code>. This expression does not have to return anything.
</li>
<li>lineCount: The number of line of the text field. Use
<code>1</code> for a single line text field or
<code>5</code> (for example) for a multiline text field.
</li>
<li>style: The style of the text widget.</li>
<li>conditionalStyles: All the conditional styles of the text widget.</li>
</ul>
<h3 id="displayestringeattribute">Display an EString EAttribute</h3>
<p>In order to display in the user interface a text widget with the value of an EAttribute with the eType EString (i.e. the name of an EObject), you can create a text widget with the following properties:</p>
<ul>
<li>labelExpression:
<code>aql:'Name:'</code>
</li>
<li>valueExpression:
<code>aql:self.name</code>
</li>
<li>editExpression:
<code>aql.self.eSet('name', newValue)</code>
</li>
</ul>
<p>EEF does not provide a default interpreter but you can easily configure EEF to be used with the AQL interpreter. In the integration of EEF with the AQL interpreter, you can register additional services, written in Java, in which you can expose to AQL new operations. The operation
<code>eSet(java.lang.String, java.lang.Object)</code> used in the example does not exist in AQL. You would have to create it yourself.
</p>
</md-content>