Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Create a command that generate code
Create a command that generate code [message #34436] Sat, 29 September 2007 13:00 Go to next message
Eclipse UserFriend
Originally posted by: ijerez2001.msn.com

I need help with a GMF editor.

I need create code from a GMF model, so, I want to create a command in the
menu for GMF editor that call to a command to generate code.
I try to use JET, but I don´t know link my model with the command.

Thanks.
Re: Create a command that generate code [message #34538 is a reply to message #34436] Mon, 01 October 2007 12:22 Go to previous messageGo to next message
Paul Elder is currently offline Paul ElderFriend
Messages: 849
Registered: July 2009
Senior Member
Ivan:

I will assume that you know how to create a command in a GMF editor. If not,
please ask the GMF newsgroup.

As for invoking JET from that command, do the following.

1) get the EMF Resource object for your model. From any model element, you
can get this by calling modelElement.eResource().

2) Call JET as follows:

JET2Platform.runTransformOnObject( "your jet transformations plug-in
id", theEMFResource, aProgressMonitor);

The method returns an IStatus that contains any execution error messages.

Paul

"Iv
Re: Create a command that generate code [message #34570 is a reply to message #34538] Mon, 01 October 2007 15:29 Go to previous message
Eclipse UserFriend
Originally posted by: ijerez2001.gmail.com

Thanks Paul.

"Paul Elder" <pelder@ca.ibm.com> escribió en el mensaje de
noticias:fdqosn$m9f$1@build.eclipse.org...
> Ivan:
>
> I will assume that you know how to create a command in a GMF editor. If
> not, please ask the GMF newsgroup.
>
> As for invoking JET from that command, do the following.
>
> 1) get the EMF Resource object for your model. From any model element, you
> can get this by calling modelElement.eResource().
>
> 2) Call JET as follows:
>
> JET2Platform.runTransformOnObject( "your jet transformations plug-in
> id", theEMFResource, aProgressMonitor);
>
> The method returns an IStatus that contains any execution error messages.
>
> Paul
>
> "Iván Jerez" <ijerez2001@msn.com> wrote in message
> news:fdli99$o3v$1@build.eclipse.org...
>>I need help with a GMF editor.
>>
>> I need create code from a GMF model, so, I want to create a command in
>> the menu for GMF editor that call to a command to generate code.
>> I try to use JET, but I don´t know link my model with the command.
>>
>> Thanks.
>>
>>
>
>
Previous Topic:MOFScript with EMF UML2 v1.0.0 XMI
Next Topic:[JET2]
Goto Forum:
  


Current Time: Thu Apr 25 02:15:27 GMT 2024

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

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

Back to the top