Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Generate of PlantUML code for the model (multiple files)
Generate of PlantUML code for the model (multiple files) [message #1232113] Thu, 16 January 2014 09:06 Go to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
How can i generate PlantUML code for my whole model, not for the current file (mydsl) only?

At the moment I'm using:

override String getDiagramText(IEditorPart editorPart, IEditorInput editorInput) {
        // Retrieve the "semantic" EMF from XtextEditor
        val document = (editorPart as XtextEditor).getDocumentProvider().getDocument(editorInput) as XtextDocument;
        val DomainModel model = document.readOnly[
            return contents.head as DomainModel
        ]
.....


Sorry, but I'm a Eclipse/XText/PlantUML newbie Embarrassed

Thanks Simon
Re: Generate of PlantUML code for the model (multiple files) [message #1232169 is a reply to message #1232113] Thu, 16 January 2014 10:54 Go to previous messageGo to next message
Uli Merkel is currently offline Uli MerkelFriend
Messages: 250
Registered: June 2013
Senior Member
have a look at "allContents" I think (depending on the ScopeProvider) this will access all the DSLs in the workspace.

This example is from the XTEXT Project
// fsa.generateFile('greetings.txt', 'People to greet: ' +
// resource.allContents
// .filter(typeof(Greeting))
// .map[name]
// .join(', '))
Re: Generate of PlantUML code for the model (multiple files) [message #1232191 is a reply to message #1232169] Thu, 16 January 2014 11:57 Go to previous messageGo to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
But, how can I access to allContents?
Re: Generate of PlantUML code for the model (multiple files) [message #1232234 is a reply to message #1232113] Thu, 16 January 2014 13:36 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
For code generation the proper hook is IGenerator.
Or do you want to get PlantUML file on the fly to show it in a view,
i.e. see the dirty editor's state as a diagram?

Also what is the 'whole model'? How do you know which files contribute
to that?

Am 16/01/14 10:06, schrieb Simon Ziehme:
> How can i generate PlantUML code for my whole model, not for the current
> file (mydsl) only?
>
> At the moment I'm using:
>
> override String getDiagramText(IEditorPart editorPart, IEditorInput
> editorInput) {
> // Retrieve the "semantic" EMF from XtextEditor
> val document = (editorPart as
> XtextEditor).getDocumentProvider().getDocument(editorInput) as
> XtextDocument;
> val DomainModel model = document.readOnly[
> return contents.head as DomainModel
> ]
> ....
>
> Sorry, but I'm a Eclipse/XText/PlantUML newbie :blush:
> Thanks Simon


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Generate of PlantUML code for the model (multiple files) [message #1232240 is a reply to message #1232234] Thu, 16 January 2014 13:52 Go to previous messageGo to next message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Sorry for my bad english.

I have a model (mydsl) with interfaces, components, layer ...

...
DomainModel:
	(types+=Type)*
	(layer+=Layer)*
	(threads+=ParentThread)*
	(interfaces+=Interface)*
	(components+=Component)*
	(applications+=Application)*;
...


Now i have e.g. many different files (*.mydsl)
One file for each component and so one p.p.

Code generation works fine for me.
Now i need one PlantUML diagram for all files togehter to visualize my (component) model.

Thx Simon

Re: Generate of PlantUML code for the model (multiple files) [message #1232259 is a reply to message #1232240] Thu, 16 January 2014 14:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
http://kthoms.wordpress.com/2011/07/12/xtend-generating-from-multiple-i
nput-models/

--
Need training, onsite consulting or any other kind of help for Xtext?
Go visit http://xtext.itemis.com or send a mail to xtext at itemis dot de


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Generate of PlantUML code for the model (multiple files) [message #1232547 is a reply to message #1232259] Fri, 17 January 2014 07:11 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
Note, that you are deactivating incremental build with this approach,
that is you will load and process all models on every tiny change.

Alternatively, you could register an explicit action just to generate
the PlantUML model, so you separate that generation from the rest.

Am 16/01/14 15:34, schrieb Christian Dietrich:
> http://kthoms.wordpress.com/2011/07/12/xtend-generating-from-multiple-i
> nput-models/
>


--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
Re: Generate of PlantUML code for the model (multiple files) [message #1232549 is a reply to message #1232547] Fri, 17 January 2014 07:18 Go to previous message
Simon Ziehme is currently offline Simon ZiehmeFriend
Messages: 22
Registered: November 2013
Junior Member
Thanks all.

I think i try to seperate the uml generation from the rest.

Best regards

Simon
Previous Topic:Embedded editor and crossreferncing to surounding EMF model
Next Topic:Error while upgrading xtext 2.1 to 2.5 in Eclipse 3.7
Goto Forum:
  


Current Time: Fri Apr 19 00:45:11 GMT 2024

Powered by FUDForum. Page generated in 0.01883 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top