24
Integration of textual and graphical editors in Eclipse (Mid-term presentation) Edin Dudojević Supervision: Mark van den Brand (TU/e) Arjan Mooij (ESI)

Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Embed Size (px)

Citation preview

Page 1: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Integration of textual and graphical editors in Eclipse (Mid-term presentation)

Edin Dudojević Supervision: • Mark van den Brand (TU/e) • Arjan Mooij (ESI)

Page 2: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Presentation overview

• Introduction • Integration requirements • Available technology

• Partial-model editing

• Graphically • Textually

• Questions

/ Department of Computer Science PAGE 1 19-2-2014

Page 3: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Introduction SHESim

/ Department of Computer Science PAGE 2 19-2-2014

SHESim Editor

Need for this master project as a result from work of Zlatka Manevska: • re-design SHESim, improve usability and user experience • Migrate to the Eclipse platform • Use both graphical and textual editors for models

• Integration of graphical and textual editor no success

Eclipse

Focus in my project is not on SHESim but on the problem in general

Page 4: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Introduction Problem

When creating models we usually also want to view and edit them in some way:

• View: a representation of (a part) of the model − Textual, graphical, tree-view, ..

• Editor: a view that allows us to manipulate and save our model

/ Department of Computer Science PAGE 3 19-2-2014

Page 5: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Introduction Problem

Models tend to get big • Use high-level (layered) or partial model views • Show only relevant parts of model

But we want more • Multiple editors on the same (partial) model • Both textually and graphically

We need full synchronization! • Propagation of changes to all views

/ Department of Computer Science PAGE 4 19-2-2014

Page 6: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Introduction Problem statement

We want to be able to edit our model from multiple editors, both textually and graphically, while keeping everything synchronized, independent of the model language being used. Questions: • How can this be done in a systematic and generic way? • Are there any patterns that we can identify?

/ Department of Computer Science PAGE 5 19-2-2014

Page 7: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Integration requirements

Use cases: • SLCO and POOSL languages

High-level integration requirements • Hierarchical views • Propagation of changes − Adding/removing elements − Dealing with references

/ Department of Computer Science PAGE 6 19-2-2014

Page 8: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Frameworks for textual editors • Xtext, EMFText Frameworks for graphical editors • GMF/EuGENia, Graphiti/Spray..

Available technology

A lot of technologies available, which ones to use?

/ Department of Computer Science PAGE 7 19-2-2014

Low-level Intermediate level

High level { { {

Page 9: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Available technology

/ Department of Computer Science PAGE 8 19-2-2014

Easy choice: Xtext and GMF! • Most widely used • Large communities • Good documentation

(relatively)

But what do Xtext and GMF provide out of the box?

Page 10: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Available technology (cntd.)

Xtext – GMF synchronization

Greetings DEMO

PAGE 9 19-2-2014 / Department of Computer Science

Page 11: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Available technology (cntd.)

• Xtext – GMF synchronization DEMO

/ name of department PAGE 10 19-2-2014

greetings.mydsl greetings.mydsl_diagram

Xtext editor

….. <element xmi:type="myDsl:Greeting" href="greetings.mydsl#//@greetings.0"/> ….

GMF editor

Hello Earth!

Hello Earth! Earth

Page 12: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Available technology (cntd.)

• Xtext – GMF synchronization DEMO

/ name of department PAGE 11

greetings.mydsl greetings.mydsl_diagram ….. <element xmi:type="myDsl:Greeting" href="greetings.mydsl#//@greetings.0"/> ….

Hello Earth!

Meta-model

19-2-2014

Page 13: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Available technology (cntd.)

• Xtext – GMF synchronization DEMO

PAGE 12 19-2-2014

These are synchronizations on entire models

How about partial-model editing?

/ Department of Computer Science

Page 14: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing

/ Department of Computer Science PAGE 13 19-2-2014

Page 15: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

ecore

genmodel

HL.gmfgraph Sub.gmfgraph

HL.gmftool

HL.gmfmap

HL.gmftool

Sub.gmfmap

/ Department of Computer Science PAGE 14 19-2-2014

HL.gmfgen Sub.gmfgen

We can even create recursive sub-diagrams (i.e. folders and files on an OS)

Partial-model editing GMF sub-diagrams

Page 16: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing GMF sub-diagrams

/ Department of Computer Science

Web application DEMO

Page 17: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing GMF sub-diagrams

/ Department of Computer Science

high-level model editor Meta-model

A B

Page 18: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing GMF sub-diagrams

/ Department of Computer Science

Meta-model

A

x

y

B

z

sub-diagram model-editor

high-level model editor

Page 19: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing

/ Department of Computer Science

Page 20: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing Xtext

Can we simply do the same thing with Xtext?

/ Department of Computer Science PAGE 19 19-2-2014

• Unfortunately, no. (no out-of-the-box feature to do this) • There are a couple of significant issues:

1. Xtext usually only works with physical files − Should we create separate files for sub-models? − Separate Xtext editors, similar to the GMF approach?

2. Xtext+GMF on same semantical in-memory model = problem − A separate in-memory resource for an Xtext instantiation?

This is still a work in progress

Page 21: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing Xtext

Other things to keep in mind

/ Department of Computer Science PAGE 20 19-2-2014

• Where do we instantiate the Xtext editor? • Adapt the default code or can we extend it? • Performance issues? • Maintenance of code • Future-proofness − To some point resistant to Xtext/GMF/Eclipse changes − Small changes to meta-model should not be a problem

Page 22: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Partial-model editing Xtext

/ Department of Computer Science PAGE 21 19-2-2014

What have others done? • Multiple repositories with proof-of-concept code

− Old versions of Xtext/Eclipse/EMF/etc. (period of 2009-2011) − No documentation

• Multiple eclipse-based tools with embedded editors − MPS (DSL development environment) − Yakindu Statecharts Tools (seems most promising approach a.t.m.) − Evolve (architecture modeling) − etc.

Page 23: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Summary

• Graphical model navigation (GMF) • ☑ Graphical partial models in new tabs

• Textual model navigation (Xtext)

• ☑ In-diagram embedded label editor • ☐ In-diagram embedded sub-tree editor • ☐ Textual partial models in new tabs

/ Department of Computer Science PAGE 22 19-2-2014

Page 24: Integration of textual and graphical editors in Eclipse ... · PDF fileIntegration of textual and graphical editors in Eclipse ... • Where do we instantiate the Xtext editor?

Questions?

? / Department of Computer Science PAGE 23 19-2-2014