[CommonNavigator] Handling Global 'Open' to open an Editor [message #336150] |
Tue, 26 May 2009 20:54 |
Eclipse User |
|
|
|
Originally posted by: aczerwonka.3esi.com
I think we have a problem, and I'm not sure how to solve it.
I have a registered ActionProvider that I want kicked in whenever the use
double-clicks on an item in the CommonNavigator. The way I solve the
problem is I set the global action handler for the OPEN action to my action
like this:
actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N, _myAction);
This works just fine, as it does open my editor as expected. The problem is
that the editor gets activated and takes focus away from the navigator, and
subsequent dbl-clicks are ignored until I manually give focus back to the
editor.
Can someone help me solve this problem?
-andy
|
|
|
Re: [CommonNavigator] Handling Global 'Open' to open an Editor [message #336151 is a reply to message #336150] |
Tue, 26 May 2009 20:57 |
Eclipse User |
|
|
|
Originally posted by: aczerwonka.3esi.com
BTW, you can see the same behaviour in the IDE's Package Explorer, except
that in this case the Dbl-Click is not being ignored because I'm guessing
(??) that the IDE doesn't override the global OPEN handler?
"Andy Czerwonka" <aczerwonka@3esi.com> wrote in message
news:gvhkum$7fu$1@build.eclipse.org...
>I think we have a problem, and I'm not sure how to solve it.
>
> I have a registered ActionProvider that I want kicked in whenever the use
> double-clicks on an item in the CommonNavigator. The way I solve the
> problem is I set the global action handler for the OPEN action to my
> action like this:
>
> actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N, _myAction);
>
>
>
> This works just fine, as it does open my editor as expected. The problem
> is that the editor gets activated and takes focus away from the navigator,
> and subsequent dbl-clicks are ignored until I manually give focus back to
> the editor.
>
> Can someone help me solve this problem?
>
>
> -andy
>
|
|
|
Re: [CommonNavigator] Handling Global 'Open' to open an Editor [message #336152 is a reply to message #336150] |
Tue, 26 May 2009 21:36 |
Eclipse User |
|
|
|
Originally posted by: aczerwonka.3esi.com
When I look at the code in the OpenActionProvider in the resources
navigator, it also uses the setGlobalActionHandler strategy. I'm not sure
what I'm doing wrong if anything...
"Andy Czerwonka" <aczerwonka@3esi.com> wrote in message
news:gvhkum$7fu$1@build.eclipse.org...
>I think we have a problem, and I'm not sure how to solve it.
>
> I have a registered ActionProvider that I want kicked in whenever the use
> double-clicks on an item in the CommonNavigator. The way I solve the
> problem is I set the global action handler for the OPEN action to my
> action like this:
>
> actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N, _myAction);
>
>
>
> This works just fine, as it does open my editor as expected. The problem
> is that the editor gets activated and takes focus away from the navigator,
> and subsequent dbl-clicks are ignored until I manually give focus back to
> the editor.
>
> Can someone help me solve this problem?
>
>
> -andy
>
|
|
|
Re: [CommonNavigator] Handling Global 'Open' to open an Editor [message #336173 is a reply to message #336150] |
Wed, 27 May 2009 19:49 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Andy Czerwonka wrote:
> I think we have a problem, and I'm not sure how to solve it.
>
> I have a registered ActionProvider that I want kicked in whenever the use
> double-clicks on an item in the CommonNavigator. The way I solve the
> problem is I set the global action handler for the OPEN action to my action
> like this:
>
> actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N, _myAction);
>
>
>
> This works just fine, as it does open my editor as expected. The problem is
> that the editor gets activated and takes focus away from the navigator, and
> subsequent dbl-clicks are ignored until I manually give focus back to the
> editor.
What does the code look like that is opening the editor?
The IWorkbenchPage.openEditor() method allows you to specify whether or
not the opened editor is activated (as do the methods in the class
org.eclipse.ui.ide.IDE which just delegate to IWorkbenchPage).
Hope this helps,
Eric
|
|
|
Re: [CommonNavigator] Handling Global 'Open' to open an Editor [message #336228 is a reply to message #336173] |
Mon, 01 June 2009 22:42 |
Eclipse User |
|
|
|
Originally posted by: aczerwonka.3esi.com
I solved it. There's a setFocus() method you better override on the editor.
Set this to something in your UI or else the activation doesn't actually get
kicked in properly.
"Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
news:gvk5gj$8s4$1@build.eclipse.org...
> Andy Czerwonka wrote:
>> I think we have a problem, and I'm not sure how to solve it.
>>
>> I have a registered ActionProvider that I want kicked in whenever the use
>> double-clicks on an item in the CommonNavigator. The way I solve the
>> problem is I set the global action handler for the OPEN action to my
>> action like this:
>>
>> actionBars.setGlobalActionHandler(ICommonActionConstants.OPE N,
>> _myAction);
>>
>>
>>
>> This works just fine, as it does open my editor as expected. The problem
>> is that the editor gets activated and takes focus away from the
>> navigator, and subsequent dbl-clicks are ignored until I manually give
>> focus back to the editor.
>
> What does the code look like that is opening the editor?
> The IWorkbenchPage.openEditor() method allows you to specify whether or
> not the opened editor is activated (as do the methods in the class
> org.eclipse.ui.ide.IDE which just delegate to IWorkbenchPage).
>
> Hope this helps,
> Eric
|
|
|
|
Powered by
FUDForum. Page generated in 0.03805 seconds