blob: 9a9604c90f97a738020fd267aeab23b18c552bf5 [file] [log] [blame]
<md-content layout="column" layout-align="center stretch" class="content">
<ul class="breadcrumb">
<li><a href="#/documentation/2.0.2">2.0.2</a> <span class="divider">/</span></li>
<li><a href="#/documentation/2.0.2/language/overview">Language</a></li>
<h2 id="Page">Page</h2>
<h3 id="description">Description</h3>
<p>The page is the first concept directly related to the user interface that you will manipulate. It will contain or reference everything displayed in the user interface. Using the Sirius integration, each page will create a new tab in the Properties view.</p>
<h3 id="properties">Properties</h3>
<li>identifier: This property is used to identify the page, it is used by the EEF runtime in order to find out if the user interface must be recreated from scratch or if it can be reused during a change of selection.</li>
<li>labelExpression: The label expression is used in order to compute the label of the page. Using the Sirius integration, this expression will be used to compute the label of the tab in the Properties view. This expression must return a string.</li>
<li>domainClass: The domain class is used in order to determine if the page can be used for the current input. If the page uses a domain class, it will only be displayed if the current input is an EObject with an EClass which directly matches the domain class or with one of its superclass matching the domain class.</li>
<li>semanticCandidateExpression: The semantic candidate expression is used to select the object that will be used as the current context of the page. It allows you for example, to use an object as the input of the view but then decide that in a specific page, you want to display the properties of another object. This expression must return one object or a collection of objects to be used as the new context of the page. More information are available below in order to create multiple pages from one definition.</li>
<li>preconditionExpression: The precondition expression is used in order to determine if the page should be displayed or not. This expression must return a boolean.</li>
<li>groups: The list of the
<a href="#/documentation/2.0.2/language/group">groups</a> that should be used in this page.
<li>semanticValidationRules: The validation rules of the page. For more details regarding the validation in EEF, have a look at the documentation of the
<a href="#/documentation/2.0.2/language/validation">validation</a>.
<li>actions: The list of the Toolbar Actions used to create buttons in the toolbar of the page. Those actions can contain a tooltipExpression wich should return a string used as the tooltip, an actionExpression executed when the user will click on the button and an imageExpression used to configure the appearance of the button. The imageExpression must return a string with the following structure PROJECT_NAME/IMAGE_PATH, for example: org.eclipse.sample/icons/Icon.gif</li>
<h4 id="variables">Variables</h4>
<p>The semantic candidate expression will have access to two variables
<code>self</code> and
<code>input</code> from the view. The result of the semantic candidate expression will be accessible as the new context in the variable
<code>self</code> for the other expressions of the page and the concept under the page.
<p>The label expression and the precondition expression (along the expressions in the semantic validation rules) will have access to both the variable
<code>input</code> and the variable
<code>self</code> which will now contain the value of the semantic candidate expression of the page.
<h3 id="multiplepagesfromonedefinition">Create multiple pages from one definition</h3>
<p>If you have a very complex meta-model, you cannot possibly create the definition of your user interface widgets after widgets. In order to handle those situation, you need more powerful mechanisms. Using the same approach and vocabulary as Eclipse Sirius, you can create in EEF several pages from a single definition using the semantic candidate expression.</p>
<p>The goal of the semantic candidate expression is to let you determine which object will be used as the context of the page. By default, if you do not specify the semantic candidate expression, we will reuse the input of the view. As usual, in our examples we will use expressions based on AQL, with this in mind, not specifying a semantic candidate expression is the same as using
<code>aql:self</code>. In the semantic candidate expression, the variable
<code>self</code> is the input of the view.
<p>You could also change the current object used in the page by using the expression
<code>aql:self.anotherObject</code>. You could type pretty much any valid expressions to navigate to another object but with this mechanism you can also create multiple pages from your semantic candidate expression if this expression returns a collection of objects instead of one object.
<p>If you use the expression
<code>aql:self.otherObjects-&gt;select(object | object.isValid())</code> as the semantic candidate expression, you will create one page for each object returned by your expression. This way, you can have a simple definition which will be able to handle dozens of elements in your domain.