blob: 890f72a300082d37c444178596abcf9da03f9d5c [file] [log] [blame]
<md-content layout="column" layout-align="center stretch" class="content">
<ul class="breadcrumb">
<li><a href="#/documentation/2.0.1">2.0.1</a> <span class="divider">/</span></li>
<li><a href="#/documentation/2.0.1/language/overview">Language</a> <span class="divider">/</span></li>
<li><a href="#/documentation/2.0.1/language/widgets">Widgets</a></li>
</ul>
<h2 id="Checkbox">Checkbox</h2>
<h3 id="description">Description</h3>
<p>The checkbox can be used to easily display and edit a boolean property. The properties available on this widget are very similar to the ones available on a
<a href="#/documentation/2.0.1/language/widgets/text">
<strong>text</strong>
</a> widget. 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 checkbox widget. This expression must return a boolean.</li>
<li>editExpression: The edit expression will be executed when the user will click in the checkbox widget. The current value of the checkbox will be accessible in a variable named
<code>newValue</code>. The variable
<code>newValue</code> is a
<code>java.lang.Boolean</code>. This expression does not have to return anything.
</li>
<li>style: The style of the checkbox widget.</li>
<li>conditionalStyles: All the conditional styles of the checkbox widget.</li>
</ul>
<h3 id="displayebooleaneattribute">Display an EBoolean EAttribute</h3>
<p>In order to display in the user interface a checkbox with the value of an EAttribute with the eType EBoolean (i.e. the property abstract of an EObject), you can create a checkbox widget with the following properties:</p>
<ul>
<li>labelExpression:
<code>aql:'Abstract:'</code>
</li>
<li>valueExpression:
<code>aql:self.abstract</code>
</li>
<li>editExpression:
<code>aql:self.eSet('abstract', 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>