Development of forms editors based on Ecore metamodels

2,038 views
1,948 views

Published on

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,038
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Development of forms editors based on Ecore metamodels

  1. 1. <ul><li>Mario Cervera Úbeda – Prodevelop </li></ul><ul><li>(mcervera@prodevelop.es) </li></ul><ul><li>José Manuel García Valladolid – Indra </li></ul><ul><li>( jmgarciav@indra.es) </li></ul>Development of forms editors based on Ecore metamodels
  2. 2. Contents <ul><li>Introduction </li></ul><ul><li>Technology used </li></ul><ul><li>Framework structure </li></ul><ul><li>Additional features </li></ul><ul><li>Demo </li></ul><ul><li>Future of the framework </li></ul><ul><li>Conclusions </li></ul>
  3. 3. Introduction <ul><li>FEFEM (Forms Editors Framework for Ecore Models) is a framework whose main goal is to make easier the development of form-based editors which manipulate models based on Ecore metamodels. </li></ul>
  4. 4. Introduction <ul><li>FEFEM facilitates this task by implementing a series of patterns that are usually found when developing form-based editors. </li></ul><ul><ul><ul><li>Editors core: contributor, pages, ... </li></ul></ul></ul><ul><ul><ul><li>GUI: widgets, composites, ... </li></ul></ul></ul><ul><li>Forms editor development = pattern composition </li></ul>
  5. 5. Introduction <ul><li>Example of pattern: The need to show and edit in a textbox the value of a property of type String. </li></ul>
  6. 6. Introduction <ul><li>Example (cont): How to use the composite in your editor? </li></ul><ul><ul><li>Creating a composite that subclasses EMFPropertyStringComposite and implementing its abstract methods. </li></ul></ul>
  7. 7. Introduction <ul><li>Pattern composition </li></ul>
  8. 8. Technology used <ul><li>EMF (Eclipse Modeling Framework) </li></ul><ul><ul><li>FEFEM's purpose is to facilitate the development of forms editors that manipulate EMF models. </li></ul></ul><ul><ul><li>http://www.eclipse.org/modeling/emf/ </li></ul></ul>
  9. 9. Technology used <ul><li>SWT (Standard Widget Toolkit) and JFace </li></ul><ul><ul><li>FEFEM's composites have been created using the widgets that SWT and JFace provide. </li></ul></ul><ul><ul><li>http://www.eclipse.org/swt/ </li></ul></ul>
  10. 10. Technology used <ul><li>Databinding </li></ul><ul><ul><li>Databinding is used to bind widgets and model properties so that their states are synchronized and to allow the user to modify the properties through the widgets. </li></ul></ul><ul><ul><ul><li>Widgets </li></ul></ul></ul><ul><ul><ul><ul><li>org.eclipse.jface.databinding.swt </li></ul></ul></ul></ul><ul><ul><ul><li>Model </li></ul></ul></ul><ul><ul><ul><ul><li>org.eclipse.emf.databinding </li></ul></ul></ul></ul><ul><ul><ul><ul><li>org.eclipse.emf.databinding.edit </li></ul></ul></ul></ul>
  11. 11. Framework Structure <ul><li>FEFEM's core </li></ul><ul><ul><li>FEFEM defines four basic classes that must be extended to create a new form-based editor. </li></ul></ul><ul><ul><ul><li>FEFEMEditor </li></ul></ul></ul><ul><ul><ul><li>FEFEMEditorContributor </li></ul></ul></ul><ul><ul><ul><li>FEFEMEditorPlugin </li></ul></ul></ul><ul><ul><ul><li>FEFEMPage </li></ul></ul></ul>
  12. 12. Framework Structure <ul><li>FEFEM's core (cont) </li></ul><ul><ul><li>FEFEMEditor </li></ul></ul><ul><ul><ul><li>This class contains the editing domain and the resource associated to the editor. </li></ul></ul></ul><ul><ul><ul><li>The class extending FEFEMEditor must be set as the property class of the new editor added in the extension point org.eclipse.ui.editors. </li></ul></ul></ul>
  13. 13. Framework Structure <ul><li>FEFEM's core (cont) </li></ul><ul><ul><li>FEFEMEditorContributor </li></ul></ul><ul><ul><ul><li>This class takes on the installation / uninstallation of global actions. </li></ul></ul></ul><ul><ul><ul><li>The class extending FEFEMEditorContributor must be set as the property contributorClass of the new editor added in the extension point org.eclipse.ui.editors. </li></ul></ul></ul>
  14. 14. Framework Structure <ul><li>FEFEM's core (cont) </li></ul><ul><ul><li>FEFEMEditorPlugin </li></ul></ul><ul><ul><ul><li>This class represents the whole plug-in. By extending this class, the plug-in gets the most common eclipse plug-in capabilities. </li></ul></ul></ul><ul><ul><ul><li>The class extending FEFEMEditorPlugin must be set as the property Activator in the tab Overview of the file MANIFEST.MF </li></ul></ul></ul>
  15. 15. Framework Structure <ul><li>FEFEM's core (cont) </li></ul><ul><ul><li>FEFEMPage </li></ul></ul><ul><ul><ul><li>Contains the functionality that every page of a form-based editor must have. </li></ul></ul></ul><ul><ul><ul><li>Every form-based editor must have one class extending FEFEMPage for each page that it has. </li></ul></ul></ul>
  16. 16. Framework Structure <ul><li>Composites to manage properties </li></ul><ul><ul><li>EMFPropertyBooleanComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type Boolean of an EObject. </li></ul></ul></ul>
  17. 17. Framework Structure <ul><li>Composites to manage properties (cont) </li></ul><ul><ul><li>EMFPropertyStringComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type String of an EObject. </li></ul></ul></ul>
  18. 18. Framework Structure <ul><li>Composites to manage properties (cont) </li></ul><ul><ul><li>EMFPropertyStringTextComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type String of an EObject through a multiline text box. </li></ul></ul></ul>
  19. 19. Framework Structure <ul><li>Composites to manage properties (cont) </li></ul><ul><ul><li>EMFPropertyStringStyledTextComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type String of an EObject through a formatable multiline text box. </li></ul></ul></ul>
  20. 20. Framework Structure <ul><li>Composites to manage properties (cont) </li></ul><ul><ul><li>EMFPropertyEEnumComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type Enumeration of an EObject. </li></ul></ul></ul>
  21. 21. Framework Structure <ul><li>Composites to manage properties (cont) </li></ul><ul><ul><li>EMFPropertyMultipleEEnumComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type Enumeration of an EObject with multiplicity higher than one. </li></ul></ul></ul>
  22. 22. Framework Structure <ul><li>Composites to manage properties (cont) </li></ul><ul><ul><li>EMFPropertyEReferenceComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type EReference of an EObject. </li></ul></ul></ul>
  23. 23. Framework Structure <ul><li>Composites to manage properties (cont) </li></ul><ul><ul><li>EMFPropertyMultipleEReferenceComposite </li></ul></ul><ul><ul><ul><li>Management of a property of type EReference of an EObject with multiplicity higher than one. </li></ul></ul></ul>
  24. 24. Framework Structure <ul><li>Composites to manage objects </li></ul><ul><ul><li>EMFEObjectComposite </li></ul></ul><ul><ul><ul><li>Management of an EObject. </li></ul></ul></ul>
  25. 25. Framework Structure <ul><li>Composites to manage objects (cont) </li></ul><ul><ul><li>EMFContainedCollectionEditionComposite </li></ul></ul><ul><ul><ul><li>Edition of collections of EObjects </li></ul></ul></ul>
  26. 26. Framework Structure <ul><li>Composites to manage objects (cont) </li></ul><ul><ul><li>EMFHierarchyEditionComposite </li></ul></ul><ul><ul><ul><li>Edition of hierarchical collections of EObjects </li></ul></ul></ul>
  27. 27. Additional features <ul><li>Data Input Validation I </li></ul><ul><ul><li>Databinding: MVC Pattern </li></ul></ul><ul><ul><li>Changes are commited to both ends following an UpdateValueStrategy managed by the Controller (Databinding core). </li></ul></ul>
  28. 28. Additional features <ul><li>Data Input Validation II </li></ul><ul><ul><li>Every FEFEM Composite can customize its UpdateValueStrategy by giving to it: </li></ul></ul><ul><ul><ul><li>A set of custom data Validators (IValidators) and/or data Convertors (Iconvertor). </li></ul></ul></ul><ul><ul><ul><li>The moment when those validations and conversions must be applied: before/after, read/write, to/from, source/target. </li></ul></ul></ul>
  29. 29. Additional features <ul><li>Internationalization </li></ul><ul><ul><li>NLS-Enabled editor plugin using Eclipse String Externalization tools. </li></ul></ul><ul><ul><li>Distribute the language specific traslation files as a Eclipse plug-in Fragment project. </li></ul></ul>
  30. 30. Additional features <ul><li>Master / detail </li></ul><ul><ul><li>FEFEM composites can be either master or detail, depending on whether you pass a Viewer or an EObject as parameter in the constructor. </li></ul></ul><ul><ul><li>Supported by databinding. </li></ul></ul><ul><ul><ul><li>emf.databinding / jface.databinding.viewers </li></ul></ul></ul>
  31. 31. Demo
  32. 32. Future of the framework <ul><li>Improvement / creation of composites: </li></ul><ul><ul><li>Image and binary data. </li></ul></ul><ul><ul><li>Usability. </li></ul></ul><ul><ul><li>Support for more model patterns. </li></ul></ul><ul><li>Integration with EMF Validation framework: model constraints would be managed by forms editors. </li></ul><ul><li>Make easier the management of FEFEM composites in interface layout (UI Designer). </li></ul>
  33. 33. Conclusions <ul><li>FEFEM provides a series of classes that can be used to make the development of form-based editors much faster than it would be if the editors were developed from scratch. </li></ul><ul><li>These classes implement common patterns that have been found developing this kind of editors. </li></ul><ul><li>The framework is still evolving. </li></ul>
  34. 34. <ul><li>Mario Cervera Úbeda – Prodevelop </li></ul><ul><li>(mcervera@prodevelop.es) </li></ul><ul><li>José Manuel García Valladolid – Indra </li></ul><ul><li>( jmgarciav@indra.es) </li></ul>Development of forms editors based on Ecore metamodels

×