3

I am learning eclipse plugin development and a great deal of learning can be done by looking at the implementation of an existing builtin plugin itself. While I was looking for a shortcut to switch between tabs I found this --> Eclipse HotKey: how to switch between tabs?

However I am not able to search the command /key binding/ Handler class that actually implements the Ctrl+PageDown key binding.

Similarly, I was able to find the key binding and the command of of M3+PAGE_DOWN (ALT+PAGE_DOWN) in plugins/org.eclipse.ui_some_version.jar (org.eclipse.ui_3.103.0.v20120705-114351.jar in my case) but not the Handler.

How can I find these out? Which plugin should I refer to?

Community
  • 1
  • 1
user1422163
  • 145
  • 1
  • 9

2 Answers2

0

Those commands get handled programatically inside org.eclipse.ui.part.MultiPageEditorPart.
Good tools for analysing the origin of elements are the "Plug-In Registry" View, the "Plug-In Spy" and Google.

0

You can find the handler in org.eclipse.ui.workbench (see class org.eclipse.ui.part.MultiPageEditorPart)

The handler is defined programmatically and not declaratively:

public abstract class MultiPageEditorPart extends EditorPart implements IPageChangeProvider {

    private static final String COMMAND_NEXT_SUB_TAB = "org.eclipse.ui.navigate.nextSubTab"; //$NON-NLS-1$

    private void initializeSubTabSwitching() {
        IHandlerService service = (IHandlerService) getSite().getService(IHandlerService.class);
        service.activateHandler(COMMAND_NEXT_SUB_TAB, new AbstractHandler() {
            // ...
            }
        });
}
mkdev
  • 972
  • 9
  • 12