How to redefine help listener for StructuredTextEditor

45 Views Asked by At

We are developing Eclipse plugin project. We are using StructuredTextEditor for displaying XML data. Now we are integrating our documentation via the standard Eclipse help system. But for StructuredTextEditor it is not working. For example:

Composite parent;
 ...
 parent.addHelpListener(new HelpListener()
   {

  @Override
  public void helpRequested(HelpEvent e)
  {
    EsbDevelopmentPlugin.showHelp(HELP_ID);
  }
   });
 parent.setFocus();
1

There are 1 best solutions below

0
greg-449 On

For text editors just call the setHelpContextId method to set the help context id.

Note that StructuredTextEditor sets the help id in the initializeEditor method so you must set your id after this, perhaps by overriding that method:

@Override
protected void initializeEditor()
{
  super.initializeEditor();

  // Set after 'super' call
  setHelpContextId("your id");
}