Context sensitive help not working. [message #474249] |
Tue, 26 August 2008 06:18  |
Eclipse User |
|
|
|
Hi,
I'm trying to provide context-sensitive help for my plug-in.
I have a html file which is the 'help' file.
I want a certain part of this help file to be shown in the workbench help
view if user presses F1 while inside a particular view of my plug-in.
I have created a contexts.xml file as below :
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.contexts"?>
<contexts>
<context id="abc">
<description>ABC description</description>
<topic label="ABC" href="html/abc.html" />
</context>
</contexts>
The extension in plugin.xml file is like this :
<extension point="org.eclipse.help.contexts">
<contexts
plugin="com.software.myPlugin"
file="contexts.xml">
</contexts>
</extension>
For now, I'd like to test it out by pressing F1 after clicking on a view.
So I use setHelp as below for the said view :
public void createPartControl(Composite parent) {
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
"com.software.myPlugin.abc");
}
I run the project and click on the view. An then I press F1.
The help doesn't come up.
Hence, context sensitive help is not working for me.
What is that i am doing wrong?
Please guide .
Thanks.
|
|
|
|
Re: Context sensitive help not working. [message #474257 is a reply to message #474256] |
Wed, 27 August 2008 09:29  |
Eclipse User |
|
|
|
Hi Chris,
I got it working.
In the method call PlatformUI.getWorkbench().getHelpSystem().setHelp()
second parameter is the contextID.
It should be prefixed with the pluginID like : "pluginID.contextID".
Now I was not sure where to find the plug-in ID for my plug-in.
So I used the value of this property : Bundle-Name from MANIFEST.MF as the
plug-in ID. Now it works.
Thanks for your reply.
|
|
|
Re: Context sensitive help not working. [message #619402 is a reply to message #474249] |
Tue, 26 August 2008 13:37  |
Eclipse User |
|
|
|
I can't immediately see anything wrong with your code. It's possible
that focus is not on the right control, - make sure the setFocus()
function in your view is doing the right thing. You can turn on
debugging of context help by creating a run configuration and in the
tracing tab checking org.eclipse.help.ui, then in the right panel
debug/context, that will show you which context is being generated.
kaprasanna wrote:
> Hi,
> I'm trying to provide context-sensitive help for my plug-in.
> I have a html file which is the 'help' file.
> I want a certain part of this help file to be shown in the workbench
> help view if user presses F1 while inside a particular view of my plug-in.
>
> I have created a contexts.xml file as below :
> <?xml version="1.0" encoding="UTF-8"?>
> <?NLS TYPE="org.eclipse.help.contexts"?>
> <contexts>
> <context id="abc">
> <description>ABC description</description>
> <topic label="ABC" href="html/abc.html" />
> </context>
> </contexts>
>
>
> The extension in plugin.xml file is like this : <extension
> point="org.eclipse.help.contexts">
> <contexts
> plugin="com.software.myPlugin"
> file="contexts.xml">
> </contexts>
> </extension>
>
> For now, I'd like to test it out by pressing F1 after clicking on a view.
> So I use setHelp as below for the said view :
>
> public void createPartControl(Composite parent) {
> PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
> "com.software.myPlugin.abc");
> }
>
> I run the project and click on the view. An then I press F1.
> The help doesn't come up.
> Hence, context sensitive help is not working for me.
> What is that i am doing wrong?
> Please guide .
> Thanks.
>
>
|
|
|
Re: Context sensitive help not working. [message #619403 is a reply to message #474256] |
Wed, 27 August 2008 09:29  |
Eclipse User |
|
|
|
Hi Chris,
I got it working.
In the method call PlatformUI.getWorkbench().getHelpSystem().setHelp()
second parameter is the contextID.
It should be prefixed with the pluginID like : "pluginID.contextID".
Now I was not sure where to find the plug-in ID for my plug-in.
So I used the value of this property : Bundle-Name from MANIFEST.MF as the
plug-in ID. Now it works.
Thanks for your reply.
|
|
|
Powered by
FUDForum. Page generated in 0.04034 seconds