| <html> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" > |
| <title>Components</title> |
| |
| <link href="book.css" rel="stylesheet" type="text/css"> |
| <link href="code.css" rel="stylesheet" type="text/css"> |
| <link rel="home" href="xtext.html" title=""> |
| </head> |
| <body> |
| <a name="Components"></a> |
| <h1>Components</h1> |
| <p> |
| Here we list the behaviors that can be customized 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.html#EmptyResourceInitializer" title="Go to "Empty Resource Initializer"">Emty Resource Initializer</a>. |
| </li> |
| <li> |
| If you want to interact with Resource Loading, you can provide a specific <a href="04-Customization.html#ResourceLoader" title="Go to "Resource Loader"">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.html#ResourceSaveManager" title="Go to "Resource Save Manager"">Resource Save Manager</a>, if you want to manage the save. |
| </li> |
| <li> |
| <a href="04-Customization.html#ResourceSaveManager" title="Go to "Resource Save Manager"">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.html#EditingDomainFinder" title="Go to "Editing Domain Finder"">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.html#Customization" title="Go to "Customization"">Customization Section</a> for a complete list. |
| </p> |
| <a name="FormComponent"></a> |
| <h2>Form Component</h2> |
| <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.6.0/org/eclipse/emf/ecore/EObject.html" title="View JavaDoc"><abbr title="org.eclipse.emf.ecore.EObject" >EObject</abbr></a> <a class="srcLink" href="https://github.com/eclipse/emf/blob/R2_8_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" > |
| <img src="images/03-components-form.png" class=" " |
| /> |
| <div class="caption"> |
| </div> |
| </div> |
| </p> |
| <p> |
| For each <a class="jdoc" href="http://download.eclipse.org/modeling/emf/emf/javadoc/2.6.0/org/eclipse/emf/ecore/EStructuralFeature.html" title="View JavaDoc"><abbr title="org.eclipse.emf.ecore.EStructuralFeature" >EStructuralFeature</abbr></a> <a class="srcLink" href="https://github.com/eclipse/emf/blob/R2_8_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.6.0/org/eclipse/emf/ecore/EClass.html" title="View JavaDoc"><abbr title="org.eclipse.emf.ecore.EClass" >EClass</abbr></a> <a class="srcLink" href="https://github.com/eclipse/emf/blob/R2_8_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 = formFactory.createFormDetailComposite(parent, SWT.NONE); |
| <br/> |
| formComposite.init(eObject); |
| <br/> |
| </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> |
| <h3>Form Customizations</h3> |
| <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.html#FeaturesProvider" title="Go to "Features Provider"">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.html#PropertyDescriptionProvider" title="Go to "Property Description Provider"">Property |
| Description Provider</a>. |
| </li> |
| <li> |
| Otherwise to customize the controls on the right, you can use the <a href="04-Customization.html#FormControlFactory" title="Go to "Form Control Factory"">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.html#ProposalProvider" title="Go to "Proposal Provider"">Proposal Provider</a>. |
| </li> |
| </ul> |
| </p> |
| <a name="TreeComponent"></a> |
| <h2>Tree Component</h2> |
| <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" > |
| <img src="images/03-components-tree.png" class=" " |
| /> |
| <div class="caption"> |
| </div> |
| </div> |
| </p> |
| <a name="Tree_Customizations"></a> |
| <h3>Tree Customizations</h3> |
| <p> |
| The <em>Tree Component</em>can be customized in several way via the standard EMF Edit facilities or with the EMF Components |
| 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.html#ViewerContentProvider" title="Go to "Viewer Content Provider"">Viewer Content Provider</a> |
| </li> |
| <li> |
| The <a href="04-Customization.html#ViewerLabelProvider" title="Go to "Viewer Label Provider"">Viewer Label Provider</a> |
| </li> |
| <li> |
| The <a href="04-Customization.html#ViewerContextMenuFactory" title="Go to "Viewer Context Menu Factory"">Viewer Context Menu Factory</a> |
| </li> |
| </ul> |
| </p> |
| <p> |
| <em>TODO</em> |
| </p> |
| <a name="TreeFormComponent"></a> |
| <h2>Tree Form Component</h2> |
| <p> |
| The <em>Tree Form Component</em> contains a <a href="03-Components.html#TreeComponent" title="Go to "Tree Component"" >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.html#FormComponent" title="Go to "Form Component"" >section FormComponent</a> detail that display the current selected object. |
| </p> |
| <p> |
| <div class="image" > |
| <img src="images/03-components-treeform.png" class=" " |
| /> |
| <div class="caption"> |
| </div> |
| </div> |
| </p> |
| <a name="TreeForm_Customizations"></a> |
| <h3>Tree Form Customization</h3> |
| <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> |
| <h2>Table Component</h2> |
| <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" > |
| <img src="images/03-components-table.png" class=" " |
| /> |
| <div class="caption"> |
| </div> |
| </div> |
| </p> |
| <p> |
| <div class="todo" > |
| To be continued |
| </div> |
| </p> |
| </body> |
| </html> |