Download presentation
Presentation is loading. Please wait.
Published byAron Brent Merritt Modified over 9 years ago
1
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo How to develop an editor for the Eclipse RCP? Ulrich Dinger ulrich.dinger.ext@siemens.com
2
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 2/19 10/7/2015 Outline Preconditions + Goal Requirements Concept Implementation/Used Tools + Frameworks Result + Metrics ( Demo )?
3
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 3/19 10/7/2015 Preconditions + Goals OIS = Configuration Language for some SBT devices Existing YACC BNF grammar (~6500 LOC) Existing ‘specification’ document (basically the BNF of the grammar) (~10 pages, incl. some mistakes) Goal Port to Java/Eclipse RCP Time frame 3 weeks version 2:2 installation "i1" { point_types { ois_point_type 1 "b" { orders { sis_order 2 "cd" true == true user_group 1 basic { reset_timer "abc" point_name @def } space "1" "2" "3" { points { sis_point_type 1 "ab" { component "component" space "space 1" sis_point_type 1 "2" { @sis = point_name }
4
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 4/19 10/7/2015 Requirements (1/2) For the first time in history of IT the requirements were precisely specified by the customer: Basically 2 (!!!) requirements: 1.“Well, some parts of the language may be represented in a tree/hierarchical view…” 2.“… others not.” 3.Should be a nice looking Eclipse RCP editor.
5
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 5/19 10/7/2015 Requirements (2/2) 1.“Should be a nice looking Eclipse RCP Editor” –gear to Eclipse Forms style 2.“Some parts represented in a tree” 3.“Others not.” –Property fields 4.Support of original syntax (incl. highlighting, …) 5.Synchronization between two views NFR -Interationalizeability -Extensibility of the editor
6
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 6/19 10/7/2015 Concept OIS CL grammar OIS CL files describes OIS CL meta model OIS xCL files describes OIS CL parser code generate read code for meta model generate read/write instantiatetransform Plain text editor for the original syntax Auto completion Syntax highlighting Tree based editor for models manipulate synchronize JET, QVT, …
7
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 7/19 10/7/2015 Implementation (1/4) Model Driven Software Development Eclipe Modeling Framework [3] –EMF: Ecore Modeling language + Code generation Ecore2Java (load/save models from/to XML/I) –EMF.Edit: Framework for creating editors for EMF models –EMF.Codegen: Model 2 code generator (JET) Disadvantages –Editors use Eclipse properties view (against one of the requirements) –Problem with large models + packages –adaptability if special problems arise So I only used the ecore modeling language + another generator + editor framework
8
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 8/19 10/7/2015 Implementation (2/4) Flexible XML based languages (FXL) project [5] –Developed at Siemens CT SE 2 since 2003; open source (source forge) –Basically an XML generator framework Transformation language (TL) on top of XSLT Pipelining/workflows of transformations –Additional package: transformation of Ecore models to Java Code + generation of customizable editors corresponds to EMF code generation + EMF.edit
9
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 9/19 10/7/2015 Implementation (3/4): Tools ANTLR Editor Ecore Editor FXL Generator Configuration TL Editor + TL2XSLT Transformation Eclipse RCP itself for the ‘glue’
10
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 10/19 10/7/2015 Implementation (4/4): Editor customization Only generic editor generated customization needed Internationalization –Via corresponding.i18n file (framework contains editor for that) Customization –Images -> copy to ‘icons’ directory + provision of LabelProvider class –Tree node texts ->.i18n file + provision of LabelProvider class –special customization interface of the framework allowing Validation of property values Specification of custom editors (for properties or complete tree nodes) Adding of context menu items Changing layout and used widgets (text fields, …) …
11
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 11/19 10/7/2015 Result
12
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 12/19 10/7/2015 Metrics Time line (15 days): Creating meta model via Ecore3 days (Re) writing the grammar in ANTLR7 days Transformation xCL2CL1 day Integration with the Editor framework + adaptation3 days Code ois.ecore 42 kB / 138 classes ois.g (ANTLR) 60 kB / 2300 LOC + ~100 (JUnit) Test cases 1000 LOC Java classes (partly hand written)20 / 1785 LOC Transformation xCL2CL (cov. by JUnit tc) 24 kB / 1200 LOC ( XSLT 57 kB / 1500 LOC ) Generated code (meta model, …) 4.62 MB / 115k LOC
13
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 13/19 10/7/2015 Open Issues 3 weeks is too short to provide a satisfying product. Still open issues: Auto completion/syntax highlighting… in text boxes some custom editors for certain parts of the model –e.g. graphical editors for expressions Resorting of the tree (now it’s mainly the AST of the language) … Horizontal layout of the editor (tree on top, properties on bottom), like in plugin.xml editor (upgrade the framework) … Comments are lost during the parsing of the CL files.
14
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 14/19 10/7/2015 Demo how to develop an editor from scratch using Ecore & the FXL framework stuff Requirements: Eclipse 3.2.x (3.1.x should also work) Java 1.4.x or 1.5.x Installed EMF (for standard Ecore editor) FXL Framework FXL Generator plug in Editor Development Ulrich Dinger
15
Siemens Corporate Research Prec+Goals Requirements Concept Implementation Results+Metrics Demo Ulrich Dinger 15/19 10/7/2015 References [1]A.Hunt, D.Thomas: The Pragmatic Programmer, Addison-Wesley, 2000 [2]Eclipse – An open development environment http://www.eclipse.org/http://www.eclipse.org/, 2007 [3]Eclipse Modeling Framework (EMF) http://www.eclipse.org/modeling/emf/?project=emfhttp://www.eclipse.org/modeling/emf/?project=emf, 2007 [4]ANTLR Parser Generator http://www.antlr.org/http://www.antlr.org/, 2007 [5]Flexible XML based languages (FXL) http://sourceforge.net/projects/fxl-project/http://sourceforge.net/projects/fxl-project/, 2007
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.