[Commands Framework] differentiating between view popup and toolbar [message #332913] |
Thu, 13 November 2008 19:34  |
Eclipse User |
|
|
|
I have a command that I want to handle in two different ways from the
view toolbar and the popup menu. From the toolbar, I want it to apply
to all items in the view (TableViewer). From the popup menu, I want it
to apply to the selection.
Is there a way to do this? I think that I would either need a way to
differentiate the context from a single handler or have two handlers and
differentiate through the handler enablement in plugin.xml. I can not
figure out how to do either.
Any suggestions?
Thanks,
Will
|
|
|
Re: [Commands Framework] differentiating between view popup and toolbar [message #332923 is a reply to message #332913] |
Fri, 14 November 2008 09:10   |
Eclipse User |
|
|
|
Won't that behaviour would be little confusing for the user? Whats wrong
with having two different commands? Something like "Mark as Read" and "Mark
all as Read" in the mail clients. Personally I would prefer that way rather
than "Mark as Read" command works on selection if invoked from popup and
works on all elements if invoked from toolbar.
- Prakash
--
http://blog.eclipse-tips.com
"Will Horn" <will.horn@gmail.com> wrote in message
news:gfhvgo$3e1$1@build.eclipse.org...
> I have a command that I want to handle in two different ways from the view
> toolbar and the popup menu. From the toolbar, I want it to apply to all
> items in the view (TableViewer). From the popup menu, I want it to apply
> to the selection.
>
> Is there a way to do this? I think that I would either need a way to
> differentiate the context from a single handler or have two handlers and
> differentiate through the handler enablement in plugin.xml. I can not
> figure out how to do either.
>
> Any suggestions?
>
> Thanks,
> Will
|
|
|
Re: [Commands Framework] differentiating between view popup and toolbar [message #332941 is a reply to message #332923] |
Fri, 14 November 2008 21:34  |
Eclipse User |
|
|
|
Prakash G.R. wrote:
> Won't that behaviour would be little confusing for the user? Whats wrong
> with having two different commands? Something like "Mark as Read" and
> "Mark all as Read" in the mail clients. Personally I would prefer that
> way rather than "Mark as Read" command works on selection if invoked
> from popup and works on all elements if invoked from toolbar.
Fair enough :) I was planning to label them differently (in my case it
would be "Stop" and "Stop All") since I can do that when I contribute to
org.eclipse.ui.menus. But two commands is reasonable and would
prevent any potential accidents if there are key bindings.
|
|
|
Powered by
FUDForum. Page generated in 0.02775 seconds