Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » F3 Action
F3 Action [message #200068] Thu, 20 October 2005 16:20 Go to next message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

Hi,

I want to implement a "Navigate into" - like functionality in my editor,
which means, if you press F3, you can navigate into the selected editpart
(opens another editor).

But

sharedKeyHandler.put(KeyStroke.getPressed(SWT.F3,0),
getActionRegistry().getAction(NavigateIntoAction.ID));

doesn
Re: F3 Action [message #200156 is a reply to message #200068] Thu, 20 October 2005 21:04 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Did you register your KeyHandler in
GraphicalEditor#configureGraphicalViewer()?
I have something like
viewer.setKeyHandler( new GraphicalViewerKeyHandler(
viewer ).setParent( sharedKeyHandler ) );


"Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
news:dj8g4t$87i$1@news.eclipse.org...
> Hi,
>
> I want to implement a "Navigate into" - like functionality in my editor,
> which means, if you press F3, you can navigate into the selected editpart
> (opens another editor).
>
> But
>
> sharedKeyHandler.put(KeyStroke.getPressed(SWT.F3,0),
> getActionRegistry().getAction(NavigateIntoAction.ID));
>
> doesn
Re: F3 Action [message #200214 is a reply to message #200068] Fri, 21 October 2005 03:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

FYI, F3 is defined as open selection (in another editor). Navigate->Go Into
has no assigned default keybinding.

But, to find out if the workbench is stealing the key, you could reassign
the Open Selection keybinding to anything else and see if that helps. You
could also print out the KeyEvent to see if it is what you expected. You may
be registering the wrong keystroke.


"Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
news:dj8g4t$87i$1@news.eclipse.org...
> Hi,
>
> I want to implement a "Navigate into" - like functionality in my editor,
> which means, if you press F3, you can navigate into the selected editpart
> (opens another editor).
>
> But
>
> sharedKeyHandler.put(KeyStroke.getPressed(SWT.F3,0),
> getActionRegistry().getAction(NavigateIntoAction.ID));
>
> doesn
Re: F3 Action [message #200258 is a reply to message #200156] Fri, 21 October 2005 08:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

Yes, I did, otherwise, any key would not work.

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dj90ph$vj4$1@news.eclipse.org...
> Did you register your KeyHandler in
> GraphicalEditor#configureGraphicalViewer()?
> I have something like
> viewer.setKeyHandler( new GraphicalViewerKeyHandler(
> viewer ).setParent( sharedKeyHandler ) );
>
>
> "Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
> news:dj8g4t$87i$1@news.eclipse.org...
> > Hi,
> >
> > I want to implement a "Navigate into" - like functionality in my editor,
> > which means, if you press F3, you can navigate into the selected
editpart
> > (opens another editor).
> >
> > But
> >
> > sharedKeyHandler.put(KeyStroke.getPressed(SWT.F3,0),
> > getActionRegistry().getAction(NavigateIntoAction.ID));
> >
> > doesn
Re: F3 Action resolved [message #200273 is a reply to message #200214] Fri, 21 October 2005 09:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

Ok, two lines of code did the trick:

1. navigationAction.setAccelerator(SWT.F3);
2. getEditorSite().getActionBars().
setGlobalActionHandler("org.eclipse.jdt.ui.actions.Open",
getActionRegistry().getAction(NavigationAction.ID));

While testing, I couldn
Re: F3 Action resolved [message #200360 is a reply to message #200273] Fri, 21 October 2005 19:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

"Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
news:djacg6$gse$1@news.eclipse.org...
> Ok, two lines of code did the trick:
>
> 1. navigationAction.setAccelerator(SWT.F3);
> 2. getEditorSite().getActionBars().
> setGlobalActionHandler("org.eclipse.jdt.ui.actions.Open",
> getActionRegistry().getAction(NavigationAction.ID));
>
> While testing, I couldn
Re: F3 Action resolved [message #200480 is a reply to message #200360] Mon, 24 October 2005 17:35 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Now I have the same problem, did you ever find out a 'proper' solution?

And where did you find the String "org.eclipse.jdt.ui.actions.Open"? It
works for me too, but I cannot get it to open a type hierarchy with F4.

Or to be more precise, my F3 and F4 work just fine in the Run-time
Workbench, but not in the IDE proper.

"Randy Hudson" <none@us.ibm.com> wrote in message
news:djbfo0$1s7$1@news.eclipse.org...
>
> "Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
> news:djacg6$gse$1@news.eclipse.org...
>> Ok, two lines of code did the trick:
>>
>> 1. navigationAction.setAccelerator(SWT.F3);
>> 2. getEditorSite().getActionBars().
>> setGlobalActionHandler("org.eclipse.jdt.ui.actions.Open",
>> getActionRegistry().getAction(NavigationAction.ID));
>>
>> While testing, I couldn
Re: F3 Action resolved [message #200517 is a reply to message #200480] Tue, 25 October 2005 08:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ingo.koch[nospam].sap.com

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:djj61t$1s8$1@news.eclipse.org...
> Now I have the same problem, did you ever find out a 'proper' solution?
Well, I don
Re: F3 Action resolved [message #200565 is a reply to message #200517] Tue, 25 October 2005 14:03 Go to previous messageGo to next message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
Thanks, now I got it to work. It looks to like you did the right thing
(except maybe for not using the constant in JdtActionConstants ;).

"Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
news:djkrvp$8ul$1@news.eclipse.org...
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:djj61t$1s8$1@news.eclipse.org...
>> Now I have the same problem, did you ever find out a 'proper' solution?
> Well, I don
Re: F3 Action resolved [message #200607 is a reply to message #200565] Tue, 25 October 2005 16:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

That's not the only problem. For example, you should not be setting the
accelerator explicitly. Instead, set the Command ID and let the workbench
set the appropriate accelerator, which may have been changed by the user.

"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:djldvc$571$1@news.eclipse.org...
> Thanks, now I got it to work. It looks to like you did the right thing
> (except maybe for not using the constant in JdtActionConstants ;).
>
> "Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
> news:djkrvp$8ul$1@news.eclipse.org...
Re: F3 Action resolved [message #203213 is a reply to message #200607] Sun, 20 November 2005 02:30 Go to previous message
Felix L J Mayer is currently offline Felix L J MayerFriend
Messages: 202
Registered: July 2009
Senior Member
I am setting the commandId/definitionId now, but I still need to set the
accelerator in the KeyHandler in order for things to work. Is this supposed
to work automatically or should I get the accelerator from the action and
put the appropriate KeyStroke with the action into the KeyHandler? In the
latter case, is there a simple way to convert the accelerator into a
KeyStroke?

"Randy Hudson" <none@us.ibm.com> wrote in message
news:djlo8l$ll2$1@news.eclipse.org...
> That's not the only problem. For example, you should not be setting the
> accelerator explicitly. Instead, set the Command ID and let the workbench
> set the appropriate accelerator, which may have been changed by the user.
>
> "Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
> news:djldvc$571$1@news.eclipse.org...
>> Thanks, now I got it to work. It looks to like you did the right thing
>> (except maybe for not using the constant in JdtActionConstants ;).
>>
>> "Ingo Koch" <ingo.koch[nospam]@sap.com> wrote in message
>> news:djkrvp$8ul$1@news.eclipse.org...
>
>
Previous Topic:how to create a connection?
Next Topic:Getting previews of editor contents
Goto Forum:
  


Current Time: Thu Mar 28 14:29:30 GMT 2024

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

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

Back to the top