Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 123040 - [Commands] request: display help topic
Summary: [Commands] request: display help topic
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Douglas Pollock CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-08 19:49 EST by Christopher Daly CLA
Modified: 2006-02-14 15:01 EST (History)
1 user (show)

See Also:


Attachments
adds command to display help topics (3.57 KB, patch)
2006-01-08 19:58 EST, Christopher Daly CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Daly CLA 2006-01-08 19:49:07 EST
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.
Comment 1 Christopher Daly CLA 2006-01-08 19:58:48 EST
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.
Comment 2 Kim Horne CLA 2006-01-09 09:26:10 EST
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.
Comment 3 Douglas Pollock CLA 2006-01-10 17:08:39 EST
(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.

Comment 4 Douglas Pollock CLA 2006-02-14 15:01:36 EST
Verified by adding a key binding to the Display Help command, and then opening help with it.