Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Accessing the editingdomain from another Plugin
Accessing the editingdomain from another Plugin [message #501765] Thu, 03 December 2009 17:29 Go to next message
Muba  is currently offline Muba Friend
Messages: 20
Registered: November 2009
Junior Member
Hi,

how can I access the editingdomain of my gmf plugin from an another
plugin that depends on it?

I tried the following, but it does not work. It does not find the
Domain, and creates a new one. But that domain has an empty ResourceSet.
------------------------------------------
TransactionalEditingDomain domain =

TransactionalEditingDomain.Registry.INSTANCE.getEditingDomai n( "COnvCreator2.diagram.EditingDomain");
if(domain==null) {
domain =
TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain();
domain.setID("COnvCreator2.diagram.EditingDomain");
}
------------------------------------------

To test it, I generated a plugin with the Hello World Command template
where I am trying to access the ResourceSet from the Handler class.

Hope someone can help me.

Muba
Re: Accessing the editingdomain from another Plugin [message #501785 is a reply to message #501765] Thu, 03 December 2009 18:27 Go to previous messageGo to next message
Ali Koudri is currently offline Ali KoudriFriend
Messages: 118
Registered: July 2009
Senior Member
Hi,

I think you should register your editing domain using the
"org.eclipse.emf.transaction.editingDomain" extension point.

Then you will be able to access your editing domain from anywhere like this:

editingDomain =
TransactionalEditingDomain.Registry.INSTANCE.getEditingDomai n( "my
editing domain id");

Hope this can help you.
Cheers.

Muba a écrit :
> Hi,
>
> how can I access the editingdomain of my gmf plugin from an another
> plugin that depends on it?
>
> I tried the following, but it does not work. It does not find the
> Domain, and creates a new one. But that domain has an empty ResourceSet.
> ------------------------------------------
> TransactionalEditingDomain domain =
>
> TransactionalEditingDomain.Registry.INSTANCE.getEditingDomai n( "COnvCreator2.diagram.EditingDomain");
>
> if(domain==null) {
> domain =
> TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain();
> domain.setID("COnvCreator2.diagram.EditingDomain");
> }
> ------------------------------------------
>
> To test it, I generated a plugin with the Hello World Command template
> where I am trying to access the ResourceSet from the Handler class.
>
> Hope someone can help me.
>
> Muba
Re: Accessing the editingdomain from another Plugin [message #501804 is a reply to message #501785] Thu, 03 December 2009 20:31 Go to previous message
Muba  is currently offline Muba Friend
Messages: 20
Registered: November 2009
Junior Member
Hi,

thanks for the reply.
That probably will do the trick.
I found the code as I posted it and tried it out, but guess once I do
this registering think it will actually work :D.

Thanks for the tip. With that Info I will find something in the internet
on how to do that exactly.


exquisitus schrieb:
> Hi,
>
> I think you should register your editing domain using the
> "org.eclipse.emf.transaction.editingDomain" extension point.
>
> Then you will be able to access your editing domain from anywhere like
> this:
>
> editingDomain =
> TransactionalEditingDomain.Registry.INSTANCE.getEditingDomai n( "my
> editing domain id");
>
> Hope this can help you.
> Cheers.
>
> Muba a écrit :
>> Hi,
>>
>> how can I access the editingdomain of my gmf plugin from an another
>> plugin that depends on it?
>>
>> I tried the following, but it does not work. It does not find the
>> Domain, and creates a new one. But that domain has an empty ResourceSet.
>> ------------------------------------------
>> TransactionalEditingDomain domain =
>>
>> TransactionalEditingDomain.Registry.INSTANCE.getEditingDomai n( "COnvCreator2.diagram.EditingDomain");
>>
>> if(domain==null) {
>> domain =
>> TransactionalEditingDomain.Factory.INSTANCE.createEditingDom ain();
>> domain.setID("COnvCreator2.diagram.EditingDomain");
>> }
>> ------------------------------------------
>>
>> To test it, I generated a plugin with the Hello World Command template
>> where I am trying to access the ResourceSet from the Handler class.
>>
>> Hope someone can help me.
>>
>> Muba
Previous Topic:Background issue after upgrade
Next Topic:Create a node with Command AND setting EAttribute?
Goto Forum:
  


Current Time: Mon Apr 19 01:22:32 GMT 2021

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

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

Back to the top