context help: infopop or help view and plugin attribute on contexts extension point [message #467556] |
Mon, 07 May 2007 09:54 |
Wouter van Atteveldt Messages: 9 Registered: July 2009 |
Junior Member |
|
|
LS,
I am trying to add help to my RCP application using the eclipse help system.
I was able to do everything I wanted, mainly due to the help chapter in the
McAffer/Lemieux 'eclipse RCP' book and the 'Describing and packaging
context-sensitive help content' eclipse help topic
( http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/help_context_xml.htm).
However, there were two things that were non-trivial and not very well
documented as far as I could see, so I thought I'd share them with the
community. Obviously, if I got anything wrong please let me know!
(1) Context-sensitive help in a separate plug-in: the plugin attribute on
the contexts extension point
To connect a part of your applicaiton with a specific entry in the help
system, you need to set the context id of a control (see the link above). In
the contexts.xml file in the help system you create an entry linking the
context id to one or more help topics. These topics are displayed in the
help view or infopop if the user presses F1 (on windows).
- The context ID set in the application should be fully qualified (ie
"org.example.app.ui.myview" asssuming a view myview in the plugin
org.example.app.ui)
- The context ID in the contexts.xml file should be relative (ie "myview")
- The contexts.xml file should be in the help providing plugin (ie
org.example.app.help)
- The help *providing* plugin should contain the org.eclipse.help.contexts
extension point.
- This file extension point points to the contexts.xml file (which is
also in the same plugin)
- The optional plugin attribute in this extension point points to the
plugin 'consuming' the help, ie to org.example.app.ui. This links the
provider and consumer: the relative context id in the contexts.xml file is
expanded relative to this id. [This is the point that I could not find in
the docs]
(Optionally, if the context ID contains more nesting than just plugin
(org.example.app.ui.views.myview) the 'plugin' extension point should
contain the nesting as well, ie point not just to the plugin but to the
package (or whatever) inside the plugin.)
<extension point="org.eclipse.help.contexts">
<contexts file="contexts.xml" plugin="nl.contentanalysis.app.ui"/>
</extension>
(2) Infopos versus help views
In recent Eclipse versions (from 3.0?), the F1 post-it style infopop popup
was replaced by a sidebar-style help view. However, on dialog screens (at
least for the TitleAreaDialog) this help is displayed as a infopop if the
dialog is not tall enough to display the view. The threshold seems to be
around 350 pixels for the content area. Strange enough, the main screen
always displays the help in a view, even if the screen is very small. I
don't know whether this is a bug or a feature.
Thanks,
Wouter
|
|
|
Powered by
FUDForum. Page generated in 0.02294 seconds