Freitag, 18. Oktober 2013

Polishing Papyrus Xtext Integration


During the last weeks we supported the Papyrus team on polishing the xtext integration into their graphical editors. For those of you, who do not know Papyrus yet - "Papyrus is a graphical editing tool for UML2 diagrams. It provides a very advanced support for UML profiles enabling support for "pure" DSL. Every part of Papyrus may be customized: model explorer, diagram editors, property editors, etc."

(X)Text in Papyrus

Papyrus offers graphical editors for all of the different UML diagrams. For some parts of the UML models, it provides textual languages - this is especially useful when using complex statements like expressions. The Papyrus team already provides a lot of grammars for different UML elements, for example
  • Properties in class diagrams
  • Transition expressions between states in state diagrams
  • Ports in component diagrams  


    Xtext-based in-diagram editors

    While the language grammars were already provided by the papyrus team, we added the Xtext-based in-diagram editor (maybe you know it from one of my previous posts) to the graphical editors.


    The in-diagram editor provides all those cool features like code completion, syntax highlighting, validation, cross referencing  that you know from your xtext editor but it is also a very lightweight component that fits seemlessly into the graphical editor. Give it a try - it is really cool. ;-)








    Since Papyrus has a slightly different editing paradigm than Yakindu Statecharts, you have to press "F2" instead of a double click to open the in-diagram editor. The same applies to the Model Explorer integration. Just select the Class Property you want to change in the Papyrus Model Explorer and press F2 to open a CellEditor with full-blown xtext support.





    For more complex expressions, an single-line CellEditor might not be well suited. For those cases, we added an Advanced Editing tab to the Properties view.



    If you use UML for whatever reason, you should definitely give Papyrus a try as an alternative to your propritary UML tool. Thanks to the papyrus team for the great cooperation!