Hi All,
I have a managed C project, in which I have to provide
context sensitive help in the text editor.
For this I have created my plug-in
‘test.contextsensitivehelp’
I have used an extension point
‘org.eclipse.help.contexts’ and defined new ‘contexts’
Below is the code for that.
<extension
point="org.eclipse.help.contexts">
<contexts
file="context_help.xml"
plugin="org.eclipse.cdt.ui"/>
</extension>
In context_help.xml I have defined
<contexts>
<context id="test_help" title="my test
help">
<description>my test help.</description>
<topic href="" label="test Help"/>
</context>
</contexts>
Also I have used one more extension point
‘org.eclipse.cdt.ui.CHelpProvider’ in which I have registered
contextID in the java class.
I am not sure if this is correct, but after implementing ICHelpProvider
,its function gets called after F1 is pressed.
<extension
point="org.eclipse.cdt.ui.CHelpProvider">
<provider
class="test.contextsensitivehelp.ContextSensetiveHelp"
id="test_help"/>
</extension>
And in class ContextSensetiveHelp.java which implements
ICHelpProvider I have registered contextID with setHelp method.
PlatformUI.getWorkbench().getHelpSystem().setHelp(sh,HelpConstants.TEST_HELP);
Now if F1 is clicked any where inside the editor it shows
test.html along with ‘Editor view’ ‘s html file.
Can I show specific help depending upon on which word F1 is
pressed.
For example :
In eclipse if there is a code
String test = null;
And if my cursor is there on keyword string and I press F1,
it shows
Java help:
Javadoc for 'java.lang.String'
In similar manner how can I achieve similar type of
functionality for my C code.
Thanks in advance.
Best Regards,
Harish Dewan
System Executive , Advanced
Technology Solutions - Semiconductor Solutions Group | KPIT Cummins
Infosystems Ltd. | +91 020 2538 2358 x 421 | harishd@xxxxxxxxxxxxxxx
| www.kpitcummins.com