Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Platform - User Assistance (UA) » Context sensitive help not working.
Context sensitive help not working. [message #474249] Tue, 26 August 2008 10:18 Go to next message
Prasanna K is currently offline Prasanna K
Messages: 78
Registered: July 2009
Member
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 #474256 is a reply to message #474249] Tue, 26 August 2008 17:37 Go to previous messageGo to next message
Chris Goldthorpe is currently offline Chris Goldthorpe
Messages: 815
Registered: July 2009
Senior Member
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 #474257 is a reply to message #474256] Wed, 27 August 2008 13:29 Go to previous message
Prasanna K is currently offline Prasanna K
Messages: 78
Registered: July 2009
Member
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 17:37 Go to previous message
Chris Goldthorpe is currently offline Chris Goldthorpe
Messages: 815
Registered: July 2009
Senior Member
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 13:29 Go to previous message
Prasanna K is currently offline Prasanna K
Messages: 78
Registered: July 2009
Member
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.
Previous Topic:Showing help after pressing a button
Next Topic:How to add anchor to href in a call to displayHelpResource
Goto Forum:
  


Current Time: Sat Oct 25 16:14:46 GMT 2014

Powered by FUDForum. Page generated in 0.02325 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software