|
Re: Generate diagram code programmatically [message #235943 is a reply to message #235936] |
Fri, 10 July 2009 10:56 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
Achilleas a écrit :
>
> Hi there,
>
> Does anyone can give me a name of a GMF class (if it exists) that can be
> used to start my implementation in order to generate the diagram code
> programmatically from JAva?
>
> Thanks,
>
> Achilleas
>
Hi Achilleas,
Perhaps org.eclipse.gmf.codegen.util.Generator
Aurelien Pupier
|
|
|
|
Re: Generate diagram code programmatically [message #235957 is a reply to message #235950] |
Fri, 10 July 2009 11:27 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
Achilleas a écrit :
>
> Hi Pupier,
>
> From the search and the attempts I am doing to accomplish the
> generation I also reached the same conclusion. Actually I am trying to
> do it like this:
>
> GmfGenGenerator gmfgenerator = new GmfGenGenerator();
>
> CodegenEmitters emitters = new CodegenEmitters(true, null, false);
>
> Generator gen = new Generator(gmfgenerator, emitters);
>
> The problem is that I don't find any way to access the gmfgen model
> through these classes. So there is no possibility to generate anything
> without at least having access to the generation model:)
>
> Thanks for the suggestion,
>
> Achilleas.
>
Access to the genmodel instance seems to be the problem ^^
In the plug-in of Peter Nehrer ( http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg18284.html) :
private Diagnostic loadGenModel() {
ResourceSet srcResSet = new ResourceSetImpl();
srcResSet.getURIConverter().getURIMap().putAll(EcorePlugin.c omputePlatformURIMap());
ModelLoadHelper loadHelper = new ModelLoadHelper(srcResSet, genModelURI);
Object root = loadHelper.getContentsRoot();
if (root instanceof GenDiagram)
genModel = ((GenDiagram) root).getEditorGen();
else if (root instanceof GenEditorGenerator)
genModel = (GenEditorGenerator) root;
if (genModel != null && genModel.getDomainGenModel() != null)
genModel.getDomainGenModel().reconcile();
return loadHelper.getDiagnostics();
}
But it doesn't work for me : http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg18902.html
|
|
|
|
Re: Generate diagram code programmatically [message #235981 is a reply to message #235974] |
Fri, 10 July 2009 12:06 |
Eclipse User |
|
|
|
Originally posted by: aurelien.pupier.esial.net
This is a multi-part message in MIME format.
--------------010907010502080501060205
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Achilleas a
|
|
|
|
Powered by
FUDForum. Page generated in 0.03377 seconds