Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » load resource while launching plug gin
load resource while launching plug gin [message #420472] Tue, 01 July 2008 12:20 Go to next message
Luis Pedro is currently offline Luis PedroFriend
Messages: 29
Registered: July 2009
Junior Member
Dear all,
Anyone has an idea if it is possible to load a resource automatically
when launching the pluggin generated by EMF code generator? I explain
better. Imagine I have a metamodel lib.ecore and a model sitea.lib. When
I lauch the eclipse runtime after generating the code from lib.genmodel
I'd like to be able to load the sitea.lib resource automatically when I
create a new model instance of lib.ecore.
Is it possible to modify the generated code in order to allow this?

Thanks very much in advance for your help.

Best regards,

Luis Pedro
Re: load resource while launching plug gin [message #420476 is a reply to message #420472] Tue, 01 July 2008 12:27 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Luis,

You could specialize the generated editor's createModel method to load
additional resources as the editor opens.


Luis Pedro wrote:
> Dear all,
> Anyone has an idea if it is possible to load a resource
> automatically when launching the pluggin generated by EMF code
> generator? I explain better. Imagine I have a metamodel lib.ecore and
> a model sitea.lib. When I lauch the eclipse runtime after generating
> the code from lib.genmodel I'd like to be able to load the sitea.lib
> resource automatically when I create a new model instance of lib.ecore.
> Is it possible to modify the generated code in order to allow this?
>
> Thanks very much in advance for your help.
>
> Best regards,
>
> Luis Pedro


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: load resource while launching plug gin [message #420479 is a reply to message #420476] Tue, 01 July 2008 13:20 Go to previous message
Luis Pedro is currently offline Luis PedroFriend
Messages: 29
Registered: July 2009
Junior Member
Thanks Ed,
In my case this will be hard-coded. So I just had to add

editingDomain.loadResource("file:/sitea.lib")

to the createModel.

Thanks very much for your hint.

LP

Ed Merks wrote:
> Luis,
>
> You could specialize the generated editor's createModel method to load
> additional resources as the editor opens.
>
>
> Luis Pedro wrote:
>> Dear all,
>> Anyone has an idea if it is possible to load a resource
>> automatically when launching the pluggin generated by EMF code
>> generator? I explain better. Imagine I have a metamodel lib.ecore and
>> a model sitea.lib. When I lauch the eclipse runtime after generating
>> the code from lib.genmodel I'd like to be able to load the sitea.lib
>> resource automatically when I create a new model instance of lib.ecore.
>> Is it possible to modify the generated code in order to allow this?
>>
>> Thanks very much in advance for your help.
>> Best regards,
>>
>> Luis Pedro
Previous Topic:Warnings in generated code for model package
Next Topic:loading of sub model element fails ?
Goto Forum:
  


Current Time: Fri Apr 19 08:01:28 GMT 2024

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

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

Back to the top