Eclipse上下文帮助

Jas*_*ley 5 eclipse-gef

现在我可以在Eclipse WizardDialog/Editor中注册上下文帮助.

1)我创建了一个help_contexts.xml文件.

<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.contexts"?>
<contexts>
   <context  id="my.plugin.help.general" >
        <description>test</description>
        <topic label="test" href="http://domain.com/help.html"/>
   </context>
</contexts>
Run Code Online (Sandbox Code Playgroud)

2)我在plugin.xml中引用了这个文件

  <extension
         point="org.eclipse.help.contexts">
         <contexts file="help_contexts.xml" plugin="my.plugin.MainEditor">
         </contexts>
   </extension>
Run Code Online (Sandbox Code Playgroud)

3)我在build.properties中添加了一行,将此文件包含在bin目录中(bin.includes = help_contexts.xml,...)

4)当运行我的基于GEF的插件时,我看到"在动态帮助下找不到匹配的my.plugin.MainEditor".

我知道我需要在某个地方创建这样的东西,但我不知道在哪里为WizardDialog或者至少为我的整个编辑器设置它:

  public void createPartControl(Composite parent) {
      ...
      PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, 
         "my.plugin.help.general");
   }
Run Code Online (Sandbox Code Playgroud)

注意:这个问题最初包含两个问题.我删除了要在其他地方发布的第一个(未答复的部分).

Jas*_*ley 10

以下是您的操作方法:1)我创建了一个help_contexts.xml文件.上下文ID中没有句点.不要在那里包含您的插件名称.

<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.contexts"?>
<contexts>
   <context  id="help_general" >
        <description>test</description>
        <topic label="test" href="http://domain.com/help.html"/>
   </context>
</contexts>
Run Code Online (Sandbox Code Playgroud)

2)我在plugin.xml中引用了这个文件如果你引用自己的插件,请不要包含plugin-id.

 <extension
         point="org.eclipse.help.contexts">
         <contexts file="help_contexts.xml">
         </contexts>
   </extension>
Run Code Online (Sandbox Code Playgroud)

3)我在build.properties中添加了一行,将此文件包含在bin目录中(bin.includes = help_contexts.xml,...).请注意Manifest.MF中的Bundle-SymbolicName(也可以在plugin.xml编辑器中看到).示例:my.plugin

4)在WizardPage中设置上下文ID(信用转到@VonC)

public class MyWizardPage extends WizardPage
    public void createControl(Composite parent) {
        PlatformUI.getWorkbench.getHelpSystem.setHelp(parent, "my.plugin.help_general");
    }
}
Run Code Online (Sandbox Code Playgroud)