Hi all,

Why do we need a difference between HandledMenuItem and DirectMenuItem ?
Ok, there is two different mechanisms, the first one uses a reference to the
command and the second uses contribution.

But, we could merge by using URIs in both cases :
We could keep the existing URI based contribution
(platform:/plugin/org.eclipse.e4.demo.contacts/org.eclipse.e4.demo.contacts.handlers.ExitHandler)
For former HandledMenuItem, we could use 'urn:command:command_id'

This approach makes it possible to provide a metamodel where the user adds
by its nature and not by how it will be related to execution.
Another benefit is that we will divide by two the number of required classes
in metamodel for building our toolbars and menus :-D


Regards,

Olivier


2010/3/7 Tom Schindl <[email protected]>

> Would my proposal in the other reply give us the best of both worlds?
>
> If one has access to the command instance one uses a CommandItem else a
> ReferencedCommandItem, if you add an EOperation to acccess the command
> the framework itself doesn't even have to deal with the difference how
> the Command-Instance is retrieved.
>
> I think that in a world made up of contributions I can't access a
> Command-EObject defined e.g. by the workbench, ... in my ModelComponent.
>
> Say I want to invoke a Command-Contributed by JDT? How would you allow
> me to invoke it in the current implementation?
>
> Tom
>
> Am 07.03.10 13:59, schrieb Paul Webster:
> > On Sun, Mar 7, 2010 at 5:44 AM, Tom Schindl <[email protected]>
> wrote:
> >> Hi,
> >> I think a HandledItem needs to hold the command-id it wants to call and
> >> not the Command-Instance itself.
> >
> > it's like that because "in theory" you can't define a HandledMenuItem
> > or HandledToolItem without a command.  If we make it an ID then we
> > have to do reference checking everywhere we use it in the app.  We
> > also have to maintain the lookup to get the command every time we need
> > it.
> >
> > But since that's what we've always done, I don't think it's a big deal
> > if you want to change it from a reference to simply an ID.
> >
> > PW
> >
> >
>
>
> --
> B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
> ------------------------------------------------------------------------
> tom schindl                                        geschaeftsfuehrer/CEO
> ------------------------------------------------------------------------
> eduard-bodem-gasse 5/1    A-6020 innsbruck      phone    ++43 512 935834
> _______________________________________________
> e4-dev mailing list
> [email protected]
> https://dev.eclipse.org/mailman/listinfo/e4-dev
>
_______________________________________________
e4-dev mailing list
[email protected]
https://dev.eclipse.org/mailman/listinfo/e4-dev

Reply via email to