Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » HandlerUtil getSelection methods
HandlerUtil getSelection methods [message #484734] Tue, 08 September 2009 23:05 Go to next message
Paul Glezen is currently offline Paul Glezen
Messages: 59
Registered: July 2009
Member
A HandlerUtil is often used to extract info from an ExcutionEvent during
command handler execution. The API docs list two methods in particular:

- getCurrentSelection
- getShowInSelection

What's the difference? The latter's description mentions a
ShowInContext selection. But I can't determine what this means.

- Paul
Re: HandlerUtil getSelection methods [message #484736 is a reply to message #484734] Wed, 09 September 2009 00:09 Go to previous messageGo to next message
Paul Glezen is currently offline Paul Glezen
Messages: 59
Registered: July 2009
Member
After some more playing around, the former seems to be where the mouse
was pointing at the moment of the right-click. The later seems to be
where the cursor was.

Paul Glezen wrote:
> A HandlerUtil is often used to extract info from an ExcutionEvent during
> command handler execution. The API docs list two methods in particular:
>
> - getCurrentSelection
> - getShowInSelection
>
> What's the difference? The latter's description mentions a
> ShowInContext selection. But I can't determine what this means.
>
> - Paul
Re: HandlerUtil getSelection methods [message #484748 is a reply to message #484736] Wed, 09 September 2009 02:30 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel Krügler
Messages: 853
Registered: July 2009
Senior Member
Paul Glezen wrote:
> After some more playing around, the former seems to be where the mouse
> was pointing at the moment of the right-click. The later seems to be
> where the cursor was.

I don't think that this is the correct interpretation. "ShowInContext"
has a special meaning for parts, see

http://wiki.eclipse.org/FAQ_How_do_I_make_my_view_appear_in_ the_Show_In_menu%3F

So my assumption is, that by quereing getShowInSelection() you will only
catch current selections from parts that implement IShowInSource.

HTH & Greetings from Bremen,

Daniel Krügler
Re: HandlerUtil getSelection methods [message #484894 is a reply to message #484748] Wed, 09 September 2009 11:48 Go to previous message
Paul Glezen is currently offline Paul Glezen
Messages: 59
Registered: July 2009
Member
Thanks for the link, Dan. I wasn't even aware of such a feature.

Daniel Krügler wrote:
> Paul Glezen wrote:
>> After some more playing around, the former seems to be where the mouse
>> was pointing at the moment of the right-click. The later seems to be
>> where the cursor was.
>
> I don't think that this is the correct interpretation. "ShowInContext"
> has a special meaning for parts, see
>
> http://wiki.eclipse.org/FAQ_How_do_I_make_my_view_appear_in_ the_Show_In_menu%3F
>
>
> So my assumption is, that by quereing getShowInSelection() you will only
> catch current selections from parts that implement IShowInSource.
>
> HTH & Greetings from Bremen,
>
> Daniel Krügler
Previous Topic:Problem with keybinding context
Next Topic:How To Open IWebBrowser With Internal Browser Only
Goto Forum:
  


Current Time: Mon Jul 28 18:40:37 EDT 2014

Powered by FUDForum. Page generated in 0.03734 seconds