Destructor
Destructor

Reputation: 3284

How to display context sensitive help for our own wizard?

I have made two wizard pages in eclipse plugin, actually i added another project type, called MyProject, so when the user does New->MyProject (Similar to New->Java) , the wizard page for MyProject appears. This MyProject has two pages, fill page1 and hit Next you go to page2. I added the context help in public void createControl(Composite parent) of the page that creates the wizard page by using, {First line for page1.java and second line for page2.java}

PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "my.plugin.id.context_id_page1");

and

PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "my.plugin.id.context_id_page2");

The Plugin.xml has:

<extension
         point="org.eclipse.help.contexts">
      <contexts
            file="contexts.xml"
            plugin="my.plugin.id">
      </contexts>
   </extension>

And the contexts.xml has:

<contexts>
   <context id="my.plugin.id.context_id_page1">
      <description>This wizard helps you in creating MyProject.</description>
      <topic href="http://www.google.com" label="Google it!" />
   </context>
   <context id="my.plugin.id.context_id_page2">
          <description>This wizard helps you in creating MyProject Page2.</description>
          <topic href="http://www.google.com" label="Google it!" />
   </context>
</contexts>

The Help appears when i use F1 or the question mark on left side, but if i go to page2 and then come back page1, the help does not appear! That is, New->MyProject, in Page1 and Page2 for first time it works, now if i navigate backwards, the context help does not work!
How to resolve this?
And all other functionalities are working fine!
Thanks for your help in advance.

Upvotes: 1

Views: 525

Answers (1)

greg-449
greg-449

Reputation: 111142

I think you need to set the help on the Composite you create for the wizard page, not on the parent composite.

You could use:

PlatformUI.getWorkbench().getHelpSystem().setHelp(getControl(), "context id");

may sure this is after the call to setControl().

Upvotes: 3

Related Questions