Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » [Commands Framework] differentiating between view popup and toolbar
[Commands Framework] differentiating between view popup and toolbar [message #332913] Thu, 13 November 2008 19:34 Go to next message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
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 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
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 Go to previous message
Will Horn is currently offline Will HornFriend
Messages: 265
Registered: July 2009
Senior Member
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.
Previous Topic:getConfiguredSites() method retuning an empty array
Next Topic:OleEditor for embedded editors doesn't work in RCP application
Goto Forum:
  


Current Time: Wed Jul 17 13:04:50 GMT 2024

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

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

Back to the top