blob: 227f2c9695b26d3dd3363f7e74ad3d589c8364e5 [file] [log] [blame]
<md-content layout="column" layout-align="center stretch" class="content">
<ul class="breadcrumb">
<li><a href="#/documentation/1.9.0">1.9.0</a> <span class="divider">/</span></li>
<li><a href="#/documentation/1.9.0/language/overview">Language</a></li>
</ul>
<h2 id="View">View</h2>
<h3 id="description">Description</h3>
<p>The view is the root concept of the EEF language. It is used mainly to contain the various
<a href="#/documentation/1.9.0/language/page">pages</a> and
<a href="#/documentation/1.9.0/language/page">groups</a>.
</p>
<h3 id="properties">Properties</h3>
<p>The view contains the following properties:</p>
<ul>
<li>identifier: This property is used to identify the view, while it has no direct use today, it is helpful in order to make sure that you are manipulating the view that you want.</li>
<li>labelExpression: The label expression is used in order to compute the label of the form in which the user interface is created. This expression must return a java.lang.String.</li>
<li>imageExpression: The image expression is used in order to compute the image that will be displayed for the form in which the interface is created. This expression must return a java.net.URL, additional return types may be supported later.</li>
<li>ePackages: The list of all the EPackages used by the expressions in the EEF definition. While this concept is unused today, it will be helpful to provide additional features like the validation of the expressions in the EEF definition.</li>
<li>pages: The list of the
<a href="#/documentation/1.9.0/language/page">pages</a> that may be used to create the user interface. Using the Sirius integration, each page will make EEF create a new tab in the Properties view.
</li>
<li>groups: The
<a href="#/documentation/1.9.0/language/page">groups</a> that may be used in any of the pages. Each group of the page will create a dedicated section in the user interface.
</li>
</ul>
<h4 id="variables">Variables</h4>
<p>In order to compute the label expression and the image expression, you have access to several variables:</p>
<ul>
<li>self: An instance of
<code>java.lang.Object</code> (even if most of the time, an instance of
<code>org.eclipse.emf.ecore.EObject</code> will be used) which will be the semantic element representing the input
</li>
<li>input: An instance of
<code>org.eclipse.eef.core.api.InputDescriptor</code> which will contain both the original input of the view and its the semantic element which you can access using the variable
<code>self</code>. In other concepts of your definition,
<code>self</code> may be redefined so if you want to access the original input of your view, it can always be retrieved thanks to the variable
<code>input</code>.
</li>
</ul>
<h3 id="pagesandgroups">Organization of pages and groups</h3>
<p class="image">
<img class="view-page-group1-6-0" border="0" src="sections/documentation/1.9.0/language/view-page-group.png"/>
</p>
<p>Groups are not under pages in order to be able to reuse groups in various pages. For example, in a complex meta-model with hundreds of EClasses and thousands of EStructuralFeatures, you may have dozens of those EClasses sharing some common properties (i.e. name, description), by having the ability to use a group in multiple pages, you can define a component of your user interface with various widgets, validation rules and even a specific layout that you can reuse easily.</p>
</md-content>