blob: c8c7e425686194d556ec127d66bfa96869a890c3 [file] [log] [blame]
<br style="clear:both;height:1em;">
<div id="leftcol">
<div class="nav-logo">
<a href="index.php"><img src="logo.png" style="margin-left:10px; width:155px"/></a>
</div>
<ul id="leftnav">
<li class="partentry" >
Documentation
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; " /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="01-Introduction.php">Introduction</a></div>
<ul style="display: none;" id="subToc_01-Introduction.html">
<li id="01-Introduction.html#Customizations.html" ><a href="01-Introduction.php#Customizations.php" >Customizations</a></li>
<li id="01-Introduction.html#Customizations_TheEasyWay.html" ><a href="01-Introduction.php#Customizations_TheEasyWay.php" >the Easy way</a></li>
<li id="01-Introduction.html#Customitations_TheHardWay.html" ><a href="01-Introduction.php#Customitations_TheHardWay.php" >the Hard way</a></li>
</ul>
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; " /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="02-GettingStarted.php">Getting Started</a></div>
<ul style="display: none;" id="subToc_02-GettingStarted.html">
<li id="02-GettingStarted.html#Installation.html" ><a href="02-GettingStarted.php#Installation.php" >Installation</a></li>
<li id="02-GettingStarted.html#FirstExample.html" ><a href="02-GettingStarted.php#FirstExample.php" >First Example</a></li>
<li id="02-GettingStarted.html#RCPMail.html" ><a href="02-GettingStarted.php#RCPMail.php" >RCP Mail Example</a></li>
</ul>
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; " /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="03-Components.php">Components</a></div>
<ul style="display: none;" id="subToc_03-Components.html">
<li id="03-Components.html#FormComponent.html" ><a href="03-Components.php#FormComponent.php" >Form Component</a></li>
<li id="03-Components.html#TreeComponent.html" ><a href="03-Components.php#TreeComponent.php" >Tree Component</a></li>
<li id="03-Components.html#TreeFormComponent.html" ><a href="03-Components.php#TreeFormComponent.php" >Tree Form Component</a></li>
<li id="03-Components.html#TableComponent.html" ><a href="03-Components.php#TableComponent.php" >Table Component</a></li>
</ul>
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; " /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="04-Customization.php">Customization</a></div>
<ul style="display: none;" id="subToc_04-Customization.html">
<li id="04-Customization.html#ResourceManagers.html" ><a href="04-Customization.php#ResourceManagers.php" >Managing Resources</a></li>
<li id="04-Customization.html#Providers.html" ><a href="04-Customization.php#Providers.php" >Providers</a></li>
<li id="04-Customization.html#SelectionAndMenu.html" ><a href="04-Customization.php#SelectionAndMenu.php" >Selection And Menu</a></li>
<li id="04-Customization.html#Builders.html" ><a href="04-Customization.php#Builders.php" >Builders</a></li>
<li id="04-Customization.html#Factories.html" ><a href="04-Customization.php#Factories.php" >Factories</a></li>
<li id="04-Customization.html#Viewers.html" ><a href="04-Customization.php#Viewers.php" >Viewers</a></li>
</ul>
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; " /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="05-DSL.php">EMF Parsley DSL</a></div>
<ul style="display: none;" id="subToc_05-DSL.html">
<li id="05-DSL.html#xbase.html" ><a href="05-DSL.php#xbase.php" >Xbase features</a></li>
</ul>
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; display:none" /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="06-AdvancedComponents.php">Advanced Components</a></div>
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; " /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="07-Eclipse4.php">Eclipse 4</a></div>
<ul style="display: none;" id="subToc_07-Eclipse4.html">
<li id="07-Eclipse4.html#GetFirstExample.html" ><a href="07-Eclipse4.php#GetFirstExample.php" >First Example Setup</a></li>
<li id="07-Eclipse4.html#PrepareForEclipse4Application.html" ><a href="07-Eclipse4.php#PrepareForEclipse4Application.php" >Preparing for a pure Eclipse 4 Application</a></li>
<li id="07-Eclipse4.html#CreateEclipse4Application.html" ><a href="07-Eclipse4.php#CreateEclipse4Application.php" >Create an Eclipse 4 Application</a></li>
<li id="07-Eclipse4.html#Eclipse4ApplicationAndEMFParsley.html" ><a href="07-Eclipse4.php#Eclipse4ApplicationAndEMFParsley.php" >Using an EMF Parsley TreeComposite into an Eclipse 4 Part</a></li>
<li id="07-Eclipse4.html#Eclipse4Save.html" ><a href="07-Eclipse4.php#Eclipse4Save.php" >Adding the dirty state and Save command</a></li>
</ul>
</li>
<li class="partentry" >
Appendix
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; display:none" /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="GettingSources.php">Getting Sources</a></div>
</li>
<li class="separator"><div class="separator">
<img src="triangle.gif" style="height:12px; margin-right: 2px; display:none" /><img src="triangle-90.gif" style="display:none; margin-right: 2px" height="12px" />
<a href="Downloads.php">EMF Parsley - Downloads</a></div>
</li>
</ul>
</div>
<div id="midcolumn">
<a name="Components" ></a>
<h1>Components</h1>
<div class="toc">
<ul>
<li><a href="03-Components.php#FormComponent.php" >Form Component</a></li>
<li><a href="03-Components.php#TreeComponent.php" >Tree Component</a></li>
<li><a href="03-Components.php#TreeFormComponent.php" >Tree Form Component</a></li>
<li><a href="03-Components.php#TableComponent.php" >Table Component</a></li>
</ul>
</div>
<p>
EMF Parsley is strongly component-based and for each component you can customize several behaviors.
</p>
<p>
In this section we will list firstly some of them that are commons for all components.
</p>
<p>
<ul>
<li>If you need a machanism to fill some data for the first time you use a model, you can provide
a specific implementation of <a href="04-Customization.php#EmptyResourceInitializer.php" title="Go to &quot;Empty Resource Initializer&quot;">Emty Resource Initializer</a>.</li>
<li>If you want to interact with Resource Loading, you can provide a specific <a href="04-Customization.php#ResourceLoader.php" title="Go to &quot;Resource Loader&quot;">Resource
Loader</a></li>
</ul>
</p>
<p>
For what concern saving objects, there are some specific parts that can be customized:
</p>
<p>
<ul>
<li><a href="04-Customization.php#ResourceSaveManager.php" title="Go to &quot;Resource Save Manager&quot;">Resource Save Manager</a>, if you want to manage the save.</li>
<li><a href="04-Customization.php#ResourceSaveManager.php" title="Go to &quot;Resource Save Manager&quot;">Resource Save Manager</a>, if you want to manage the save.</li>
<li>In some cases, it can be usefull to specify an editing domain to work with. In this case it can be used the <a href="04-Customization.php#EditingDomainFinder.php" title="Go to &quot;Editing Domain Finder&quot;">Editing Domain Finder</a>.</li>
</ul>
</p>
<p>
The following sections describe the basic components provided, that are the foundations for all parts built upon <em>Emf Parsley</em>.
For each component we present a set of customizations, just to get an idea of how it works. You can refer
to <a href="04-Customization.php" title="Go to &quot;Customization&quot;">Customization Section</a> for a complete list.
</p>
<a name="FormComponent" ></a>
<span style="float:left; border-top: 1px dotted #d4d4dd; margin-left: 0; margin-top: 5px;
padding: 5px 0;
padding-top: 5px;"></span><a style="float: right" href="#">Top</a>
<br style="clear:both"></br>
<h1>Form Component</h1>
<div class="toc">
<ul>
<li><a href="03-Components.php#Form_Customizations.php" >Form Customizations</a></li>
</ul>
</div>
<p>
The <em>Form Component</em> can be used to rapresent an <a class="jdoc" href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EObject.html" title="org.eclipse.emf.ecore.EObject">EObject</abbr></a> <a class="srcLink" href="https://github.com/eclipse/emf/blob/R2_9_0/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EObject.java" title="View Source Code" >(src)</a> in a row-oriented form,
like in the image above.
</p>
<p>
<div class="image" >
<a class="gallery" rel="prettyPhoto[all]" title="" href="images/03-components-form.png">
<img src="images/03-components-form.png"
width="600px"
/>
</a>
<div class="caption">
</div>
</div>
</p>
<p>
For each <a class="jdoc" href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EStructuralFeature.html" title="org.eclipse.emf.ecore.EStructuralFeature">EStructuralFeature</abbr></a> <a class="srcLink" href="https://github.com/eclipse/emf/blob/R2_9_0/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EStructuralFeature.java" title="View Source Code" >(src)</a> defined for the <a class="jdoc" href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.9.0/org/eclipse/emf/ecore/EClass.html" title="org.eclipse.emf.ecore.EClass">EClass</abbr></a> <a class="srcLink" href="https://github.com/eclipse/emf/blob/R2_9_0/plugins/org.eclipse.emf.ecore/src/org/eclipse/emf/ecore/EClass.java" title="View Source Code" >(src)</a>
(that is the type of the object to rapresent), the component builds a row with a
<em>label</em> with the name of the feature and a <em>control</em> to access the data. It can be used the factory
to create such a component, like in the code below.
</p>
<p>
<div class="literallayout">
<div class="incode">
<p class="code">
formComposite&nbsp;=&nbsp;formFactory.createFormDetailComposite(parent,&nbsp;SWT.NONE);<br/>
&nbsp;&nbsp;&nbsp;&nbsp;formComposite.init(eObject);
</p>
</div>
</div>
</p>
<p>
The <em>form component</em> can be customized in many way, in particular the feature list, the labels and the controls.
</p>
<a name="Form_Customizations" ></a>
<h2>Form Customizations</h2>
<p>
The <em>Form Component</em> can be customized in several way. Here the complete list.
</p>
<p>
<ul>
<li>The <em>list fo feature</em> displayed on the form can be customized via the <a href="04-Customization.php#FeaturesProvider.php" title="Go to &quot;Features Provider&quot;">Feature
Provider</a> to select the features or the order.</li>
<li>The description on the left side of the form caan be customizzed via the <a href="04-Customization.php#PropertyDescriptionProvider.php" title="Go to &quot;Feature Caption Provider&quot;">Property
Description Provider</a>.</li>
<li>Otherwise to customize the controls on the right, you can use the <a href="04-Customization.php#FormControlFactory.php" title="Go to &quot;Form Control Factory&quot;">Form Control Factory</a>.
</li>
<li>Depending on the feature types, can be some fields that use predefined values (e.g. combo). You can provide
the exact proposal list via the <a href="04-Customization.php#ProposalProvider.php" title="Go to &quot;Proposal Provider&quot;">Proposal Provider</a>.</li>
</ul>
</p>
<a name="TreeComponent" ></a>
<span style="float:left; border-top: 1px dotted #d4d4dd; margin-left: 0; margin-top: 5px;
padding: 5px 0;
padding-top: 5px;"></span><a style="float: right" href="#">Top</a>
<br style="clear:both"></br>
<h1>Tree Component</h1>
<div class="toc">
<ul>
<li><a href="03-Components.php#Tree_Customizations.php" >Tree Customizations</a></li>
</ul>
</div>
<p>
The <em>Tree Component</em> provides a tree rapresentation of data that can be feeded with an EResource, a
Resource URI, and a simple EObject. This component use the EMF Meta-Model information to display objects in the tree.
</p>
<p>
<div class="image" >
<a class="gallery" rel="prettyPhoto[all]" title="" href="images/03-components-tree.png">
<img src="images/03-components-tree.png"
width="600px"
/>
</a>
<div class="caption">
</div>
</div>
</p>
<a name="Tree_Customizations" ></a>
<h2>Tree Customizations</h2>
<p>
The <em>Tree Component</em>can be customized in several way via the standard EMF Edit facilities or with the EMF Parsley
codeinjection based mechanism. If you are familiar with Jface APIs, you can easily use the basic class with some facilties to define the specific implementation.
See the corrisponding sections for more details.
</p>
<p>
<ul>
<li>The <a href="04-Customization.php#ViewerContentProvider.php" title="Go to &quot;Viewer Content Provider&quot;">Viewer Content Provider</a></li>
<li>The <a href="04-Customization.php#ViewerLabelProvider.php" title="Go to &quot;Viewer Label Provider&quot;">Viewer Label Provider</a></li>
<li>The <a href="04-Customization.php#ViewerContextMenuFactory.php" title="Go to &quot;Viewer Context Menu Factory&quot;">Viewer Context Menu Factory</a></li>
</ul>
</p>
<p>
<em>TODO</em>
</p>
<a name="TreeFormComponent" ></a>
<span style="float:left; border-top: 1px dotted #d4d4dd; margin-left: 0; margin-top: 5px;
padding: 5px 0;
padding-top: 5px;"></span><a style="float: right" href="#">Top</a>
<br style="clear:both"></br>
<h1>Tree Form Component</h1>
<div class="toc">
<ul>
<li><a href="03-Components.php#TreeForm_Customizations.php" >Tree Form Customization</a></li>
</ul>
</div>
<p>
The <em>Tree Form Component</em> contains a <a href="03-Components.php#TreeComponent.php" title="Go to &quot;Tree Component&quot;" >section TreeComponent</a> that provides a tree rapresentation of data that can be feeded with
an EResource, a Resource URI, and a simple EObject. This component use the EMF Meta-Model information to display objects in
the tree. The component also combines a <a href="03-Components.php#FormComponent.php" title="Go to &quot;Form Component&quot;" >section FormComponent</a> detail that display the current selected object.
</p>
<p>
<div class="image" >
<a class="gallery" rel="prettyPhoto[all]" title="" href="images/03-components-treeform.png">
<img src="images/03-components-treeform.png"
width="600px"
/>
</a>
<div class="caption">
</div>
</div>
</p>
<a name="TreeForm_Customizations" ></a>
<h2>Tree Form Customization</h2>
<p>
Since <em>Tree Form Component</em> is a combination of <em>Tree Component</em> and <em>Form Component</em>, all their customizations
are avaible for it.
</p>
<a name="TableComponent" ></a>
<span style="float:left; border-top: 1px dotted #d4d4dd; margin-left: 0; margin-top: 5px;
padding: 5px 0;
padding-top: 5px;"></span><a style="float: right" href="#">Top</a>
<br style="clear:both"></br>
<h1>Table Component</h1>
<p>
The <em>Table Component</em> can rapresent data in a grid, once you have specified what kind of object need to be rapresented.
It uses metamodel infos to build column as needed.
</p>
<p>
<div class="image" >
<a class="gallery" rel="prettyPhoto[all]" title="" href="images/03-components-table.png">
<img src="images/03-components-table.png"
width="600px"
/>
</a>
<div class="caption">
</div>
</div>
</p>
<p>
<div class="todo" >
To be continued
</div>
</p>
<div id="disqus_thread"></div>
<script type="text/javascript" src="documentationRoot.js"></script>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'xtext'; // required: replace example with your forum shortname
// The following are highly recommended additional parameters. Remove the slashes in front to use.
var disqus_identifier = 'Components';
var disqus_url = documentationRoot+'03-Components.php';
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
<br style="clear:both;height:1em;">