现在我可以在 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>
2)我在我的plugin.xml中引用了这个文件
<extension
point="org.eclipse.help.contexts">
<contexts file="help_contexts.xml" plugin="my.plugin.MainEditor">
</contexts>
</extension>
3)我在 build.properties 中添加了一行以将此文件包含在 bin 目录中(bin.includes = help_contexts.xml,...)
4) 运行基于 GEF 的插件时,我在动态帮助下看到“未找到“my.plugin.MainEditor”的匹配项”。
我知道我需要在某个地方创建类似的东西,但我不知道在哪里为我的向导对话框或至少为我的整个编辑器设置它:
public void createPartControl(Composite parent) {
...
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent,
"my.plugin.help.general");
}
注:这个问题原本包含两个问题。我已经删除了要在其他地方发布的第一个(未答复的部分)。
操作方法如下:
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>
2) 我在我的plugin.xml 中引用了这个文件。如果您引用自己的插件,请不要包含plugin-id。
<extension
point="org.eclipse.help.contexts">
<contexts file="help_contexts.xml">
</contexts>
</extension>
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");
}
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)