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 04:06 Go to next message
Simon Ziehme is currently offline Simon Ziehme
Messages: 11
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 05:54 Go to previous messageGo to next message
Uli Merkel is currently offline Uli Merkel
Messages: 113
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 06:57 Go to previous messageGo to next message
Simon Ziehme is currently offline Simon Ziehme
Messages: 11
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 08:36 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1759
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


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : 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 08:52 Go to previous messageGo to next message
Simon Ziehme is currently offline Simon Ziehme
Messages: 11
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 09:34 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian Dietrich
Messages: 6131
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
Re: Generate of PlantUML code for the model (multiple files) [message #1232547 is a reply to message #1232259] Fri, 17 January 2014 02:11 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven Efftinge
Messages: 1759
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


--
Need professional support on Xtext or Xtend?
Mail to: xtext (at) itemis.com
Twitter : @svenefftinge
Blog : 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 02:18 Go to previous message
Simon Ziehme is currently offline Simon Ziehme
Messages: 11
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: Sat Jul 26 07:15:59 EDT 2014

Powered by FUDForum. Page generated in 0.02863 seconds