Community
Participate
Working Groups
I'm going to attach a patch to "command-ify" the opening of help topics. The command takes a parameter which is the href of a help topic. The default handler uses IWorkbenchHelpSystem.displayHelpResource(String) with the href parameter. If no parameter was given, the default handler calls IWorkbenchHelpSystem.displayHelp() instead to simply open the help system. Note that this looks like it should be opened against User Assistance, but the plugins that should be patched (I think) are org.eclipse.ui and org.eclipse.ui.workbench, so I opened against UI.
Created attachment 32651 [details] adds command to display help topics A few notes on this patch: I followed the example of the org.eclipse.ui.views.showView command by defining the command in plugin.xml of org.eclipse.ui but implementing the handler in org.eclipse.ui.workbench. I differed from "showView" in 2 ways. First I gave the parameter id a short name "href" instead of a long name like org.eclipse.ui.views.showView.viewId. I think this is ok because I think the parameter id only needs to be unique within its command. Second I made my handler internal - I put it in org.eclipse.ui.internal.handlers instead of org.eclipse.ui.handlers because I don't see why the handler itself would need to be API. If I'm wrong on any of the points above can you let me know because I'm going to be creating a number of other commands, so I want to figure out what the "best practices" are.
Please note for future reference that the target milestone field is used by platform UI to specify either when we intend on fixing a bug or when it has been fixed.
(In reply to comment #1) > I differed from "showView" in 2 ways. First I gave the parameter id a short > name "href" instead of a long name like This is what I want moving forward. The old ones have to stay long because they are now technically API. You should assign a category to a command. I've done so. I've also fixed a bug with how parameterized commands with no IParameterValues get treated in the preference page.
Verified by adding a key binding to the Display Help command, and then opening help with it.