how to include help plugin for RCP application [message #176953] |
Fri, 27 October 2006 10:03 |
Eclipse User |
|
|
|
Originally posted by: udupa.sku.gmail.com
Hi all,
I am in trouble. Please help!!!!!
Actually i have a stand alone RCP application. I have also created a help
plugin. Now i want to launch the help when the user presses a perticular
button.
How can i achive this??
|
|
|
Re: how to include help plugin for RCP application [message #176998 is a reply to message #176953] |
Fri, 27 October 2006 13:40 |
Eclipse User |
|
|
|
Originally posted by: wayne.beaton._NOSPAM_eclipse.org
sku wrote:
> Hi all, I am in trouble. Please help!!!!!
> Actually i have a stand alone RCP application. I have also created a
> help plugin. Now i want to launch the help when the user presses a
> perticular button.
> How can i achive this??
I assume that you mean context-sensitive help. When the user has the
cursor in a field and hits "F1" (or other platform equivalent), you want
to display help for that field.
This is all captured in chapter 13 of "Eclipse Rich Client Platform" by
Jeff McAffer and Jean-Michel Lemieux.
Here's the short version:
Step 1 (add the "PlatformUI" line to your code, substituting the widget
you want F1 help to work in).
private void createSubjectText(Composite parent) {
...
subjectText = new Text(parent, SWT.BORDER);
...
PlatformUI.getWorkbench().getHelpSystem()
.setHelp(subjectText, "org.eclipse.organizer.task.ui.subjectField");
}
In this case, "subjectText" is the widget. The second parameter is the
contextId. This is the combination of the plug-in id and the name of
context in a contexts.xml file (in the project root) like below:
<contexts>
<context id="subjectField">
<description>Capture the subject of the task in this
field.
</description>
<topic
label="Subject Field"
href="html/tasks/editor.html#subjectField"/>
</context>
</contexts>
As you can see, my plug-in id is "org.eclipse.organizer.task.ui".
The help file that is displayed is found in "html/tasks" in the project
root.
Finally, you need to add an extension to your plugin.xml file:
<extension
point="org.eclipse.help.contexts">
<contexts file="contexts.xml"/>
</extension>
You'll have to add org.eclipse.help to your project's dependencies.
Hope this helps,
Wayne
|
|
|
|
Powered by
FUDForum. Page generated in 0.07696 seconds