views:

170

answers:

2

How do i register an additional handler/action/command for "Open Declaration" (aka F3) in a plugin?

I want to use F3 on String literals in Java code to navigate to the files declaring resource bundle keys. I already have a context menu action ready that does the job. All that's missing is a way to bind it to the key that users are used to.

Extra credit for a complete annotated list of extension points. I'm getting tired of having to spend half a day to find the extension point i have to use for a feature. And by "annotated" i mean more than

Identifier: org.eclipse.ui.workbench.texteditor.quickdiffReferenceProvider
Description: Allows contributors to add reference providers for the quick diff display.
+1  A: 

See section on keybindings in Eclipse Commands tutorial for detailed instructions how to implement command handlers and bind them to keys, menus and toolbars.

There is a full list of extension points provided in Eclipse help, though you have to drill down to get the full description and code samples. There is also an "Add extension point" wizard in plugin editor, which shows a brief description, link to the full help and for some extension points even have predefined templates.

Eugene Kuleshov
I tried that and i was able to add a context menu item that shows i registered it for F3, but when i actually press F3, my code isn't called. Only when i select the menu item directly.
Stroboskop
+1  A: 

Perhaps you know this, but although the F3 keyboard shortcut won't take you to the declaring resource bundle key, there are two similar things that do work:

  • Hovering over the string with the mouse will show you the converted string.
  • Control-clicking the string will jump you to the declaring resource bundle key.

Obviously, these both require use of the mouse; if you are a keyboard-only kind of person, you might not be happy with these.

This doesn't directly answer your question, but I hope it helps.

Mike Morearty
Actually i am happy with these but would also like the F3 shortcut. Only they don't work for us because we're not using Resourcebundles directly. We're using a wrapper class and eclipse doesn't know what to do with calls to that unless i implement some extension points. I already did that for the control click. All i need is the extension point to use for the shortcut.
Stroboskop