Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Context sensitive help

On hover, the CHelpProvider's getFunctionInfo() is called, and the last arg
is a string of the name of the function the user was hovering over.
On F1, it looks like the function getHelpResources() gets called, and it
also has a last arg which is the name of the function on which F1 was hit.
At least, that works for me.

...Beth



|---------+---------------------------->
|         |           "Harish Dewan"   |
|         |           <harishd@KPITCumm|
|         |           ins.com>         |
|         |           Sent by:         |
|         |           cdt-dev-bounces@e|
|         |           clipse.org       |
|         |                            |
|         |                            |
|         |           02/16/2006 12:15 |
|         |           AM               |
|         |           Please respond to|
|         |           "CDT General     |
|         |           developers list."|
|---------+---------------------------->
  >-----------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                       |
  |       To:       <cdt-dev@xxxxxxxxxxx>                                                                                 |
  |       cc:                                                                                                             |
  |       Subject:  [cdt-dev] Context sensitive help                                                                      |
  >-----------------------------------------------------------------------------------------------------------------------|




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="test.html" 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
 _______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev

Back to the top