|Re: Best practices: Where should I maintain my model status? [message #885364 is a reply to message #885350]
||Tue, 12 June 2012 21:55
| Mauro Condarelli
Registered: September 2009
On 12/06/2012 23:17, Sopot Cela wrote:|
> you are trying to do some really weird things.
I know ;)
Truth is I am unable to find instructions on how to do several things
and thus I resort to experimenting.
Sometimes the experiments get a little wild ;)
> First and foremost the MPart and MPerspective cannot be cast to each
> other. They are completely different interfaces. The method findPart
> will find a MPart for you and not a MPerspective and thus the p==null. I
> guess you can use the EModelService's find to find perspectives. p
> instanceof MPerspective will NEVER be true (will throw a CCE if you
> force the cast). Tell eclipse to do a type hierarchy on each of those
> (CTRL+T) and you will get the idea.
I am still more than a little confused abiut exactly which service I
should use to get the right "piece" (Mpart, MPerspective or whatever).
I hoped there's a unified interface using the id's, but that doesn't
> Also DON'T use internals like PerspectiveStackImpl. Stick to interfaces.
I debugged and found out that's the actual type returned.
I should have used the Interface, instead.
> The menu items are kept in sync with their command. If you create your
> command on the fly with the command and handler service you should take
> care to also link the menu items with the newly created commands in
> order to keep things synced.
What is the magic spell to get the Command already linked with the menu,
instead of creating a new one?
Use EModelService, I presume, but how do I add the parameter?
Can You suggest some specific documentation?
I am mainly using Lars's excellent site, but even that is rather terse
on many subjects.
Wiki seems to be lagging way behind, or I'm unable to navigate it properly.
Thanks for Your time
Powered by FUDForum
. Page generated in 0.11193 seconds