Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Merging multiple EMF editors
Merging multiple EMF editors [message #133673] Fri, 27 February 2009 19:19 Go to next message
Eclipse UserFriend
Originally posted by: anders.opendev.se

I am not entirely experienced in the world of EMF yet but I'm slowly
getting acquainted, so please go easy on me.

I'm working with a project that has a multitude of plugins generated from
a set of different EMF models. Some of them have references to others (is
this the right terminology?)

Anyway, the major part of the models have generated *.Edit and *.Editor
plugins. The thing is that I would like to merge/write a single editor
for all models. Now I am facing some difficulties because I don't fully
understand the underlying mechanisms yet.

My thinking goes as follows:

1. I remove all the *.Editor plugins and write a general plugin based on
one of the existing editors. (But how do I accommodate for all different
aspects of the models? E.g. specific object types should be show in the
outline view depending on what model is edited. Is it possible to use
reflection somehow?)

2. I also want a single EditingDomaing for all models. How do I
accomplish this? Is there any pitfalls by simply having a "singleton"
EditingDomain?

3. To "hook up" the existing models to the new editor - what is needed?
Is it necessary to write some kind of small "wrapper/proxy" editors that
instantiate the "one and only" editor? Or how should I go about this? Is
there any settings where one can specify which editor to use?

4. Is the above approach doable or is there any better/easier way?

Thank you so much for you time!

BR,
Anders
Re: Merging multiple EMF editors [message #133691 is a reply to message #133673] Fri, 27 February 2009 19:56 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090305030608050908060900
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Anders,

Comments below.

Anders Hansson wrote:
> I am not entirely experienced in the world of EMF yet but I'm slowly
> getting acquainted, so please go easy on me.
>
I'll refrain from calling you a loser until later. Although if you
haven't bought the EMF book yet, I might still need to berate you. :-P
> I'm working with a project that has a multitude of plugins generated from
> a set of different EMF models. Some of them have references to others (is
> this the right terminology?)
>
Yep.
> Anyway, the major part of the models have generated *.Edit and *.Editor
> plugins. The thing is that I would like to merge/write a single editor
> for all models. Now I am facing some difficulties because I don't fully
> understand the underlying mechanisms yet.
>
If you look at the editors, you'll see they almost all look alike...
> My thinking goes as follows:
>
> 1. I remove all the *.Editor plugins and write a general plugin based on
> one of the existing editors. (But how do I accommodate for all different
> aspects of the models? E.g. specific object types should be show in the
> outline view depending on what model is edited. Is it possible to use
> reflection somehow?)
>
You'll want to look at this article:
< http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html>


http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html

> 2. I also want a single EditingDomaing for all models. How do I
> accomplish this? Is there any pitfalls by simply having a "singleton"
> EditingDomain?
>
Normally each editor has it's own editing domain. It's far tricker to
figure out how to share them...
> 3. To "hook up" the existing models to the new editor - what is needed?
> Is it necessary to write some kind of small "wrapper/proxy" editors that
> instantiate the "one and only" editor? Or how should I go about this? Is
> there any settings where one can specify which editor to use?
>
You'll likely be surprised that it just works. That's because the
ComposedAdapterFactory that's created uses a registry to find the item
providers for whatever object happens to show up in the editor.
> 4. Is the above approach doable or is there any better/easier way?
>
Probably you'll find you can just pick one of the editors (the one for
the "base" model) and it will be able to work nicely with all the
models, especially if you do that extensible child creation thing from
my blog...
> Thank you so much for you time!
>
> BR,
> Anders
>

--------------090305030608050908060900
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Anders,<br>
<br>
Comments below.<br>
<br>
Anders Hansson wrote:
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">I am not entirely experienced in the world of EMF yet but I'm slowly
getting acquainted, so please go easy on me.
</pre>
</blockquote>
I'll refrain from calling you a loser until later. Although if you
haven't bought the EMF book yet, I might still need to berate you. :-P<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
I'm working with a project that has a multitude of plugins generated from
a set of different EMF models. Some of them have references to others (is
this the right terminology?)
</pre>
</blockquote>
Yep.<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
Anyway, the major part of the models have generated *.Edit and *.Editor
plugins. The thing is that I would like to merge/write a single editor
for all models. Now I am facing some difficulties because I don't fully
understand the underlying mechanisms yet.
</pre>
</blockquote>
If you look at the editors, you'll see they almost all look alike...<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
My thinking goes as follows:

1. I remove all the *.Editor plugins and write a general plugin based on
one of the existing editors. (But how do I accommodate for all different
aspects of the models? E.g. specific object types should be show in the
outline view depending on what model is edited. Is it possible to use
reflection somehow?)
</pre>
</blockquote>
You'll want to look at this article:<a
href=" http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html"><br>
</a>
<blockquote><a
href=" http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html"> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html</a><br>
</blockquote>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
2. I also want a single EditingDomaing for all models. How do I
accomplish this? Is there any pitfalls by simply having a "singleton"
EditingDomain?
</pre>
</blockquote>
Normally each editor has it's own editing domain.  It's far tricker to
figure out how to share them...<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
3. To "hook up" the existing models to the new editor - what is needed?
Is it necessary to write some kind of small "wrapper/proxy" editors that
instantiate the "one and only" editor? Or how should I go about this? Is
there any settings where one can specify which editor to use?
</pre>
</blockquote>
You'll likely be surprised that it just works.  That's because the
ComposedAdapterFactory that's created uses a registry to find the item
providers for whatever object happens to show up in the editor.<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
4. Is the above approach doable or is there any better/easier way?
</pre>
</blockquote>
Probably you'll find you can just pick one of the editors (the one for
the "base" model) and it will be able to work nicely with all the
models, especially if you do that extensible child creation thing from
my blog...<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
Thank you so much for you time!

BR,
Anders
</pre>
</blockquote>
</body>
</html>

--------------090305030608050908060900--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Merging multiple EMF editors [message #133704 is a reply to message #133691] Fri, 27 February 2009 20:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: anders.opendev.se

Thanks for your reply!

See comments below.

Den Fri, 27 Feb 2009 14:56:16 -0500 skrev Ed Merks:
> I'll refrain from calling you a loser until later. Although if you
> haven't bought the EMF book yet, I might still need to berate you. :-P

Thanks, you don't know how much that means to me ;-)
And yes, I have bought the book!

>> Anyway, the major part of the models have generated *.Edit and *.Editor
>> plugins. The thing is that I would like to merge/write a single editor
>> for all models. Now I am facing some difficulties because I don't fully
>> understand the underlying mechanisms yet.
>>
> If you look at the editors, you'll see they almost all look alike...

Yes I know. And I have already written some common code/classes that they
all use to modify the behaviour of the editors. So there wouldn't be much
work on actually making them into one single editor. I think it would be
quite straight forward. My concern lies in that I'm sensing that I am
missing some important pieces of the puzzle...

> You'll want to look at this article:
> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-
know.html

Thanks a lot. That looks promosing!

>> 2. I also want a single EditingDomaing for all models. How do I
>> accomplish this? Is there any pitfalls by simply having a "singleton"
>> EditingDomain?
>>
> Normally each editor has it's own editing domain. It's far tricker to
> figure out how to share them...

Ok, do you know anything about this? Because this will becoming a major
issue since we plan on using CDO for the models and if I have my sources
right CDO requires the models to share EditingDomain... But then again, I
could be wrong, it has happened before :-/

>> 3. To "hook up" the existing models to the new editor - what is needed?
>> Is it necessary to write some kind of small "wrapper/proxy" editors
>> that instantiate the "one and only" editor? Or how should I go about
>> this? Is there any settings where one can specify which editor to use?
>>
> You'll likely be surprised that it just works. That's because the
> ComposedAdapterFactory that's created uses a registry to find the item
> providers for whatever object happens to show up in the editor.

Ok, I think I understand this. I can feel that there is some problem
lurking here but I will take your word for it for now.

>> 4. Is the above approach doable or is there any better/easier way?
>>
> Probably you'll find you can just pick one of the editors (the one for
> the "base" model) and it will be able to work nicely with all the
> models, especially if you do that extensible child creation thing from
> my blog...

Yes, I was hoping that this would be the case.

Again, thanks for your response and insights!
Re: Merging multiple EMF editors [message #133717 is a reply to message #133704] Fri, 27 February 2009 20:47 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000406030309050000070407
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Anders,

Start by assuming you can get by with an editing domain per editor and
see how far that gets you first. If you need more than that, you'll
want to start to look into the Transaction stuff.

It's best to the EMF newsgroup for future questions about EMF:

news://new.eclipse.org/eclipse.tools.emf


Anders Hansson wrote:
> Thanks for your reply!
>
> See comments below.
>
> Den Fri, 27 Feb 2009 14:56:16 -0500 skrev Ed Merks:
>
>> I'll refrain from calling you a loser until later. Although if you
>> haven't bought the EMF book yet, I might still need to berate you. :-P
>>
>
> Thanks, you don't know how much that means to me ;-)
> And yes, I have bought the book!
>
>
>>> Anyway, the major part of the models have generated *.Edit and *.Editor
>>> plugins. The thing is that I would like to merge/write a single editor
>>> for all models. Now I am facing some difficulties because I don't fully
>>> understand the underlying mechanisms yet.
>>>
>>>
>> If you look at the editors, you'll see they almost all look alike...
>>
>
> Yes I know. And I have already written some common code/classes that they
> all use to modify the behaviour of the editors. So there wouldn't be much
> work on actually making them into one single editor. I think it would be
> quite straight forward. My concern lies in that I'm sensing that I am
> missing some important pieces of the puzzle...
>
>
>> You'll want to look at this article:
>> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-
>>
> know.html
>
> Thanks a lot. That looks promosing!
>
>
>>> 2. I also want a single EditingDomaing for all models. How do I
>>> accomplish this? Is there any pitfalls by simply having a "singleton"
>>> EditingDomain?
>>>
>>>
>> Normally each editor has it's own editing domain. It's far tricker to
>> figure out how to share them...
>>
>
> Ok, do you know anything about this? Because this will becoming a major
> issue since we plan on using CDO for the models and if I have my sources
> right CDO requires the models to share EditingDomain... But then again, I
> could be wrong, it has happened before :-/
>
>
>>> 3. To "hook up" the existing models to the new editor - what is needed?
>>> Is it necessary to write some kind of small "wrapper/proxy" editors
>>> that instantiate the "one and only" editor? Or how should I go about
>>> this? Is there any settings where one can specify which editor to use?
>>>
>>>
>> You'll likely be surprised that it just works. That's because the
>> ComposedAdapterFactory that's created uses a registry to find the item
>> providers for whatever object happens to show up in the editor.
>>
>
> Ok, I think I understand this. I can feel that there is some problem
> lurking here but I will take your word for it for now.
>
>
>>> 4. Is the above approach doable or is there any better/easier way?
>>>
>>>
>> Probably you'll find you can just pick one of the editors (the one for
>> the "base" model) and it will be able to work nicely with all the
>> models, especially if you do that extensible child creation thing from
>> my blog...
>>
>
> Yes, I was hoping that this would be the case.
>
> Again, thanks for your response and insights!
>

--------------000406030309050000070407
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Anders,<br>
<br>
Start by assuming you can get by with an editing domain per editor and
see how far that gets you first.  If you need more than that, you'll
want to start to look into the Transaction stuff.<br>
<br>
It's best to the EMF newsgroup for future questions about EMF:<br>
<blockquote><a href="news://new.eclipse.org/eclipse.tools.emf">news://new.eclipse.org/eclipse.tools.emf</a><br>
</blockquote>
<br>
Anders Hansson wrote:
<blockquote cite="mid:go9hqf$o3u$2@build.eclipse.org" type="cite">
<pre wrap="">Thanks for your reply!

See comments below.

Den Fri, 27 Feb 2009 14:56:16 -0500 skrev Ed Merks:
</pre>
<blockquote type="cite">
<pre wrap="">I'll refrain from calling you a loser until later. Although if you
haven't bought the EMF book yet, I might still need to berate you. :-P
</pre>
</blockquote>
<pre wrap=""><!---->
Thanks, you don't know how much that means to me ;-)
And yes, I have bought the book!

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Anyway, the major part of the models have generated *.Edit and *.Editor
plugins. The thing is that I would like to merge/write a single editor
for all models. Now I am facing some difficulties because I don't fully
understand the underlying mechanisms yet.

</pre>
</blockquote>
<pre wrap="">If you look at the editors, you'll see they almost all look alike...
</pre>
</blockquote>
<pre wrap=""><!---->
Yes I know. And I have already written some common code/classes that they
all use to modify the behaviour of the editors. So there wouldn't be much
work on actually making them into one single editor. I think it would be
quite straight forward. My concern lies in that I'm sensing that I am
missing some important pieces of the puzzle...

</pre>
<blockquote type="cite">
<pre wrap="">You'll want to look at this article:
<a class="moz-txt-link-freetext" href=" http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt"> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt</a>-
</pre>
</blockquote>
<pre wrap=""><!---->know.html

Thanks a lot. That looks promosing!

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">2. I also want a single EditingDomaing for all models. How do I
accomplish this? Is there any pitfalls by simply having a "singleton"
EditingDomain?

</pre>
</blockquote>
<pre wrap="">Normally each editor has it's own editing domain. It's far tricker to
figure out how to share them...
</pre>
</blockquote>
<pre wrap=""><!---->
Ok, do you know anything about this? Because this will becoming a major
issue since we plan on using CDO for the models and if I have my sources
right CDO requires the models to share EditingDomain... But then again, I
could be wrong, it has happened before :-/

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">3. To "hook up" the existing models to the new editor - what is needed?
Is it necessary to write some kind of small "wrapper/proxy" editors
that instantiate the "one and only" editor? Or how should I go about
this? Is there any settings where one can specify which editor to use?

</pre>
</blockquote>
<pre wrap="">You'll likely be surprised that it just works. That's because the
ComposedAdapterFactory that's created uses a registry to find the item
providers for whatever object happens to show up in the editor.
</pre>
</blockquote>
<pre wrap=""><!---->
Ok, I think I understand this. I can feel that there is some problem
lurking here but I will take your word for it for now.

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">4. Is the above approach doable or is there any better/easier way?

</pre>
</blockquote>
<pre wrap="">Probably you'll find you can just pick one of the editors (the one for
the "base" model) and it will be able to work nicely with all the
models, especially if you do that extensible child creation thing from
my blog...
</pre>
</blockquote>
<pre wrap=""><!---->
Yes, I was hoping that this would be the case.

Again, thanks for your response and insights!
</pre>
</blockquote>
</body>
</html>

--------------000406030309050000070407--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Merging multiple EMF editors [message #133729 is a reply to message #133704] Sat, 28 February 2009 04:38 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Anders,

Comments below...



Anders Hansson schrieb:
> [...]
>> Normally each editor has it's own editing domain. It's far tricker to
>> figure out how to share them...
>>
>
> Ok, do you know anything about this? Because this will becoming a major
> issue since we plan on using CDO for the models and if I have my sources
> right CDO requires the models to share EditingDomain... But then again, I
> could be wrong, it has happened before :-/
No such requirement is imposed by CDO. CDO integrates with EMF directly
on the model layer.

Editing domains reside in an EMF layer above the model layer (generated
model code) so I would say models are generally unaware of editing
domains. There may be upstream references at runtime in the form of
adapters, but these should not force you into any particular model design.

Cheers
/Eike

----
http://thegordian.blogspot.com


Re: Merging multiple EMF editors [message #133742 is a reply to message #133729] Sat, 28 February 2009 06:24 Go to previous message
Eclipse UserFriend
Originally posted by: anders.opendev.se

Den Sat, 28 Feb 2009 05:38:36 +0100 skrev Eike Stepper:

>> Ok, do you know anything about this? Because this will becoming a major
>> issue since we plan on using CDO for the models and if I have my
>> sources right CDO requires the models to share EditingDomain... But
>> then again, I could be wrong, it has happened before :-/
>
> No such requirement is imposed by CDO. CDO integrates with EMF directly
> on the model layer.

That's good news, thanks for the information!

BR,
Anders
Re: Merging multiple EMF editors [message #620693 is a reply to message #133673] Fri, 27 February 2009 19:56 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090305030608050908060900
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Anders,

Comments below.

Anders Hansson wrote:
> I am not entirely experienced in the world of EMF yet but I'm slowly
> getting acquainted, so please go easy on me.
>
I'll refrain from calling you a loser until later. Although if you
haven't bought the EMF book yet, I might still need to berate you. :-P
> I'm working with a project that has a multitude of plugins generated from
> a set of different EMF models. Some of them have references to others (is
> this the right terminology?)
>
Yep.
> Anyway, the major part of the models have generated *.Edit and *.Editor
> plugins. The thing is that I would like to merge/write a single editor
> for all models. Now I am facing some difficulties because I don't fully
> understand the underlying mechanisms yet.
>
If you look at the editors, you'll see they almost all look alike...
> My thinking goes as follows:
>
> 1. I remove all the *.Editor plugins and write a general plugin based on
> one of the existing editors. (But how do I accommodate for all different
> aspects of the models? E.g. specific object types should be show in the
> outline view depending on what model is edited. Is it possible to use
> reflection somehow?)
>
You'll want to look at this article:
< http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html>


http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html

> 2. I also want a single EditingDomaing for all models. How do I
> accomplish this? Is there any pitfalls by simply having a "singleton"
> EditingDomain?
>
Normally each editor has it's own editing domain. It's far tricker to
figure out how to share them...
> 3. To "hook up" the existing models to the new editor - what is needed?
> Is it necessary to write some kind of small "wrapper/proxy" editors that
> instantiate the "one and only" editor? Or how should I go about this? Is
> there any settings where one can specify which editor to use?
>
You'll likely be surprised that it just works. That's because the
ComposedAdapterFactory that's created uses a registry to find the item
providers for whatever object happens to show up in the editor.
> 4. Is the above approach doable or is there any better/easier way?
>
Probably you'll find you can just pick one of the editors (the one for
the "base" model) and it will be able to work nicely with all the
models, especially if you do that extensible child creation thing from
my blog...
> Thank you so much for you time!
>
> BR,
> Anders
>

--------------090305030608050908060900
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Anders,<br>
<br>
Comments below.<br>
<br>
Anders Hansson wrote:
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">I am not entirely experienced in the world of EMF yet but I'm slowly
getting acquainted, so please go easy on me.
</pre>
</blockquote>
I'll refrain from calling you a loser until later. Although if you
haven't bought the EMF book yet, I might still need to berate you. :-P<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
I'm working with a project that has a multitude of plugins generated from
a set of different EMF models. Some of them have references to others (is
this the right terminology?)
</pre>
</blockquote>
Yep.<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
Anyway, the major part of the models have generated *.Edit and *.Editor
plugins. The thing is that I would like to merge/write a single editor
for all models. Now I am facing some difficulties because I don't fully
understand the underlying mechanisms yet.
</pre>
</blockquote>
If you look at the editors, you'll see they almost all look alike...<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
My thinking goes as follows:

1. I remove all the *.Editor plugins and write a general plugin based on
one of the existing editors. (But how do I accommodate for all different
aspects of the models? E.g. specific object types should be show in the
outline view depending on what model is edited. Is it possible to use
reflection somehow?)
</pre>
</blockquote>
You'll want to look at this article:<a
href=" http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html"><br>
</a>
<blockquote><a
href=" http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html"> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-know.html</a><br>
</blockquote>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
2. I also want a single EditingDomaing for all models. How do I
accomplish this? Is there any pitfalls by simply having a "singleton"
EditingDomain?
</pre>
</blockquote>
Normally each editor has it's own editing domain.  It's far tricker to
figure out how to share them...<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
3. To "hook up" the existing models to the new editor - what is needed?
Is it necessary to write some kind of small "wrapper/proxy" editors that
instantiate the "one and only" editor? Or how should I go about this? Is
there any settings where one can specify which editor to use?
</pre>
</blockquote>
You'll likely be surprised that it just works.  That's because the
ComposedAdapterFactory that's created uses a registry to find the item
providers for whatever object happens to show up in the editor.<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
4. Is the above approach doable or is there any better/easier way?
</pre>
</blockquote>
Probably you'll find you can just pick one of the editors (the one for
the "base" model) and it will be able to work nicely with all the
models, especially if you do that extensible child creation thing from
my blog...<br>
<blockquote cite="mid:go9ebd$o3u$1@build.eclipse.org" type="cite">
<pre wrap="">
Thank you so much for you time!

BR,
Anders
</pre>
</blockquote>
</body>
</html>

--------------090305030608050908060900--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Merging multiple EMF editors [message #620694 is a reply to message #133691] Fri, 27 February 2009 20:18 Go to previous message
Eclipse UserFriend
Originally posted by: anders.opendev.se

Thanks for your reply!

See comments below.

Den Fri, 27 Feb 2009 14:56:16 -0500 skrev Ed Merks:
> I'll refrain from calling you a loser until later. Although if you
> haven't bought the EMF book yet, I might still need to berate you. :-P

Thanks, you don't know how much that means to me ;-)
And yes, I have bought the book!

>> Anyway, the major part of the models have generated *.Edit and *.Editor
>> plugins. The thing is that I would like to merge/write a single editor
>> for all models. Now I am facing some difficulties because I don't fully
>> understand the underlying mechanisms yet.
>>
> If you look at the editors, you'll see they almost all look alike...

Yes I know. And I have already written some common code/classes that they
all use to modify the behaviour of the editors. So there wouldn't be much
work on actually making them into one single editor. I think it would be
quite straight forward. My concern lies in that I'm sensing that I am
missing some important pieces of the puzzle...

> You'll want to look at this article:
> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-
know.html

Thanks a lot. That looks promosing!

>> 2. I also want a single EditingDomaing for all models. How do I
>> accomplish this? Is there any pitfalls by simply having a "singleton"
>> EditingDomain?
>>
> Normally each editor has it's own editing domain. It's far tricker to
> figure out how to share them...

Ok, do you know anything about this? Because this will becoming a major
issue since we plan on using CDO for the models and if I have my sources
right CDO requires the models to share EditingDomain... But then again, I
could be wrong, it has happened before :-/

>> 3. To "hook up" the existing models to the new editor - what is needed?
>> Is it necessary to write some kind of small "wrapper/proxy" editors
>> that instantiate the "one and only" editor? Or how should I go about
>> this? Is there any settings where one can specify which editor to use?
>>
> You'll likely be surprised that it just works. That's because the
> ComposedAdapterFactory that's created uses a registry to find the item
> providers for whatever object happens to show up in the editor.

Ok, I think I understand this. I can feel that there is some problem
lurking here but I will take your word for it for now.

>> 4. Is the above approach doable or is there any better/easier way?
>>
> Probably you'll find you can just pick one of the editors (the one for
> the "base" model) and it will be able to work nicely with all the
> models, especially if you do that extensible child creation thing from
> my blog...

Yes, I was hoping that this would be the case.

Again, thanks for your response and insights!
Re: Merging multiple EMF editors [message #620695 is a reply to message #133704] Fri, 27 February 2009 20:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000406030309050000070407
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

Anders,

Start by assuming you can get by with an editing domain per editor and
see how far that gets you first. If you need more than that, you'll
want to start to look into the Transaction stuff.

It's best to the EMF newsgroup for future questions about EMF:

news://new.eclipse.org/eclipse.tools.emf


Anders Hansson wrote:
> Thanks for your reply!
>
> See comments below.
>
> Den Fri, 27 Feb 2009 14:56:16 -0500 skrev Ed Merks:
>
>> I'll refrain from calling you a loser until later. Although if you
>> haven't bought the EMF book yet, I might still need to berate you. :-P
>>
>
> Thanks, you don't know how much that means to me ;-)
> And yes, I have bought the book!
>
>
>>> Anyway, the major part of the models have generated *.Edit and *.Editor
>>> plugins. The thing is that I would like to merge/write a single editor
>>> for all models. Now I am facing some difficulties because I don't fully
>>> understand the underlying mechanisms yet.
>>>
>>>
>> If you look at the editors, you'll see they almost all look alike...
>>
>
> Yes I know. And I have already written some common code/classes that they
> all use to modify the behaviour of the editors. So there wouldn't be much
> work on actually making them into one single editor. I think it would be
> quite straight forward. My concern lies in that I'm sensing that I am
> missing some important pieces of the puzzle...
>
>
>> You'll want to look at this article:
>> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt-
>>
> know.html
>
> Thanks a lot. That looks promosing!
>
>
>>> 2. I also want a single EditingDomaing for all models. How do I
>>> accomplish this? Is there any pitfalls by simply having a "singleton"
>>> EditingDomain?
>>>
>>>
>> Normally each editor has it's own editing domain. It's far tricker to
>> figure out how to share them...
>>
>
> Ok, do you know anything about this? Because this will becoming a major
> issue since we plan on using CDO for the models and if I have my sources
> right CDO requires the models to share EditingDomain... But then again, I
> could be wrong, it has happened before :-/
>
>
>>> 3. To "hook up" the existing models to the new editor - what is needed?
>>> Is it necessary to write some kind of small "wrapper/proxy" editors
>>> that instantiate the "one and only" editor? Or how should I go about
>>> this? Is there any settings where one can specify which editor to use?
>>>
>>>
>> You'll likely be surprised that it just works. That's because the
>> ComposedAdapterFactory that's created uses a registry to find the item
>> providers for whatever object happens to show up in the editor.
>>
>
> Ok, I think I understand this. I can feel that there is some problem
> lurking here but I will take your word for it for now.
>
>
>>> 4. Is the above approach doable or is there any better/easier way?
>>>
>>>
>> Probably you'll find you can just pick one of the editors (the one for
>> the "base" model) and it will be able to work nicely with all the
>> models, especially if you do that extensible child creation thing from
>> my blog...
>>
>
> Yes, I was hoping that this would be the case.
>
> Again, thanks for your response and insights!
>

--------------000406030309050000070407
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Anders,<br>
<br>
Start by assuming you can get by with an editing domain per editor and
see how far that gets you first.  If you need more than that, you'll
want to start to look into the Transaction stuff.<br>
<br>
It's best to the EMF newsgroup for future questions about EMF:<br>
<blockquote><a href="news://new.eclipse.org/eclipse.tools.emf">news://new.eclipse.org/eclipse.tools.emf</a><br>
</blockquote>
<br>
Anders Hansson wrote:
<blockquote cite="mid:go9hqf$o3u$2@build.eclipse.org" type="cite">
<pre wrap="">Thanks for your reply!

See comments below.

Den Fri, 27 Feb 2009 14:56:16 -0500 skrev Ed Merks:
</pre>
<blockquote type="cite">
<pre wrap="">I'll refrain from calling you a loser until later. Although if you
haven't bought the EMF book yet, I might still need to berate you. :-P
</pre>
</blockquote>
<pre wrap=""><!---->
Thanks, you don't know how much that means to me ;-)
And yes, I have bought the book!

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Anyway, the major part of the models have generated *.Edit and *.Editor
plugins. The thing is that I would like to merge/write a single editor
for all models. Now I am facing some difficulties because I don't fully
understand the underlying mechanisms yet.

</pre>
</blockquote>
<pre wrap="">If you look at the editors, you'll see they almost all look alike...
</pre>
</blockquote>
<pre wrap=""><!---->
Yes I know. And I have already written some common code/classes that they
all use to modify the behaviour of the editors. So there wouldn't be much
work on actually making them into one single editor. I think it would be
quite straight forward. My concern lies in that I'm sensing that I am
missing some important pieces of the puzzle...

</pre>
<blockquote type="cite">
<pre wrap="">You'll want to look at this article:
<a class="moz-txt-link-freetext" href=" http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt"> http://ed-merks.blogspot.com/2008/01/creating-children-you-d idnt</a>-
</pre>
</blockquote>
<pre wrap=""><!---->know.html

Thanks a lot. That looks promosing!

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">2. I also want a single EditingDomaing for all models. How do I
accomplish this? Is there any pitfalls by simply having a "singleton"
EditingDomain?

</pre>
</blockquote>
<pre wrap="">Normally each editor has it's own editing domain. It's far tricker to
figure out how to share them...
</pre>
</blockquote>
<pre wrap=""><!---->
Ok, do you know anything about this? Because this will becoming a major
issue since we plan on using CDO for the models and if I have my sources
right CDO requires the models to share EditingDomain... But then again, I
could be wrong, it has happened before :-/

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">3. To "hook up" the existing models to the new editor - what is needed?
Is it necessary to write some kind of small "wrapper/proxy" editors
that instantiate the "one and only" editor? Or how should I go about
this? Is there any settings where one can specify which editor to use?

</pre>
</blockquote>
<pre wrap="">You'll likely be surprised that it just works. That's because the
ComposedAdapterFactory that's created uses a registry to find the item
providers for whatever object happens to show up in the editor.
</pre>
</blockquote>
<pre wrap=""><!---->
Ok, I think I understand this. I can feel that there is some problem
lurking here but I will take your word for it for now.

</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">4. Is the above approach doable or is there any better/easier way?

</pre>
</blockquote>
<pre wrap="">Probably you'll find you can just pick one of the editors (the one for
the "base" model) and it will be able to work nicely with all the
models, especially if you do that extensible child creation thing from
my blog...
</pre>
</blockquote>
<pre wrap=""><!---->
Yes, I was hoping that this would be the case.

Again, thanks for your response and insights!
</pre>
</blockquote>
</body>
</html>

--------------000406030309050000070407--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Merging multiple EMF editors [message #620696 is a reply to message #133704] Sat, 28 February 2009 04:38 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Anders,

Comments below...



Anders Hansson schrieb:
> [...]
>> Normally each editor has it's own editing domain. It's far tricker to
>> figure out how to share them...
>>
>
> Ok, do you know anything about this? Because this will becoming a major
> issue since we plan on using CDO for the models and if I have my sources
> right CDO requires the models to share EditingDomain... But then again, I
> could be wrong, it has happened before :-/
No such requirement is imposed by CDO. CDO integrates with EMF directly
on the model layer.

Editing domains reside in an EMF layer above the model layer (generated
model code) so I would say models are generally unaware of editing
domains. There may be upstream references at runtime in the form of
adapters, but these should not force you into any particular model design.

Cheers
/Eike

----
http://thegordian.blogspot.com


Re: Merging multiple EMF editors [message #620697 is a reply to message #133729] Sat, 28 February 2009 06:24 Go to previous message
Eclipse UserFriend
Originally posted by: anders.opendev.se

Den Sat, 28 Feb 2009 05:38:36 +0100 skrev Eike Stepper:

>> Ok, do you know anything about this? Because this will becoming a major
>> issue since we plan on using CDO for the models and if I have my
>> sources right CDO requires the models to share EditingDomain... But
>> then again, I could be wrong, it has happened before :-/
>
> No such requirement is imposed by CDO. CDO integrates with EMF directly
> on the model layer.

That's good news, thanks for the information!

BR,
Anders
Previous Topic:Merging multiple EMF editors
Next Topic:[EMF Compare] How to start
Goto Forum:
  


Current Time: Thu Apr 18 23:22:44 GMT 2024

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

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

Back to the top