Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Defining help contexts
Defining help contexts [message #330648] Thu, 07 August 2008 09:32 Go to next message
Tom Coxon is currently offline Tom CoxonFriend
Messages: 2
Registered: July 2009
Junior Member
I've made a plugin that declares a class extending StatusDialog, and
inherits the help button in the lower-left corner. How can I attach my
help context to it?

In plugin.xml I've got this:
<extension point="org.eclipse.help.contexts">
<contexts file="helpContexts.xml"/>
</extension>

and in helpContexts.xml I've got this:
<contexts>
<context id="mydialog_contextid">
<description>Here's my description.</description>
<topic href="html/stuff.html" label="A help topic"/>
</context>
</contexts>

I've tried overriding the protected createDialogArea method:
protected Control createDialogArea(Composite parent) {
IWorkbench workbench = PlatformUI.getWorkbench();
workbench.getHelpSystem().setHelp(parent, "mydialog_contextid");

Except then when I press the help button it says "The context help for
this user interface element could not be found." (Without the code I put
in createDialogArea it just says the default "Each workbench window
contains one or more ...", so it is doing something...)

Thanks
Tom
Re: Defining help contexts [message #330782 is a reply to message #330648] Wed, 13 August 2008 13:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Tom Coxon wrote:
> I've made a plugin that declares a class extending StatusDialog, and
> inherits the help button in the lower-left corner. How can I attach my
> help context to it?
>
> In plugin.xml I've got this:
> <extension point="org.eclipse.help.contexts">
> <contexts file="helpContexts.xml"/>
> </extension>
>
> and in helpContexts.xml I've got this:
> <contexts>
> <context id="mydialog_contextid">
> <description>Here's my description.</description>
> <topic href="html/stuff.html" label="A help topic"/>
> </context>
> </contexts>
>
> I've tried overriding the protected createDialogArea method:
> protected Control createDialogArea(Composite parent) {
> IWorkbench workbench = PlatformUI.getWorkbench();
> workbench.getHelpSystem().setHelp(parent, "mydialog_contextid");
>
> Except then when I press the help button it says "The context help for
> this user interface element could not be found." (Without the code I put
> in createDialogArea it just says the default "Each workbench window
> contains one or more ...", so it is doing something...)

I think you need to call setHelp() passing the Control that is returned
from createDialogArea() instead of the parent argument. Like this:


Hope this helps,
Eric
Re: Defining help contexts [message #330799 is a reply to message #330782] Wed, 13 August 2008 16:27 Go to previous messageGo to next message
Tom Coxon is currently offline Tom CoxonFriend
Messages: 2
Registered: July 2009
Junior Member
Then I get the default message about workbench windows, and not my help
context. :-/

Tom
Re: Defining help contexts [message #330833 is a reply to message #330799] Thu, 14 August 2008 13:20 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Tom Coxon wrote:
> Then I get the default message about workbench windows, and not my help
> context. :-/

It seems to depend on what control has focus when the Help button is
clicked. In our dialogs I call setHelp() for the result of
DialogPage.getControl() AND the Control that is returned from
createDialogControl(), and that seems to work regardless of where the
user clicks (or doesn't click) before clicking the ? button.

Hope this helps,
Eric
Previous Topic:How do I add a preferences page programatically at run time?
Next Topic:Sorting table Viewer
Goto Forum:
  


Current Time: Fri Aug 16 16:13:16 GMT 2024

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

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

Back to the top