Eclipse上下文帮助 [英] Eclipse Contextual Help

查看:102
本文介绍了Eclipse上下文帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Now can I register contextual help in an Eclipse WizardDialog/Editor.

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

1) I created a help_contexts.xml file.

<?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中引用了该文件

2) I referenced this file in my 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,...)

3) I added a line in my build.properties to include this file in the bin directory (bin.includes = help_contexts.xml, ... )

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

4) When running my GEF-based plugin, I see "No match found for "my.plugin.MainEditor"" under dynamic help.

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

I know I need to create something like this somewhere, but I don't know where to set this up for my WizardDialog or at least for my whole editor:

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

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

Note: This question originally contained two questions. I have removed the first (unanswered part) to be posted elsewhere.

推荐答案

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

Here is how you do it: 1) I created a help_contexts.xml file. Don't have periods in the context id. Don't include your plugin name in there.

<?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.

2) I referenced this file in my plugin.xml Don't include the plugin-id if you are referencing your own plugin.

 <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

3) I added a line in my build.properties to include this file in the bin directory (bin.includes = help_contexts.xml, ... ). Note your Bundle-SymbolicName in your Manifest.MF (also visible in your plugin.xml editor). Example: my.plugin

4)在WizardPage中设置上下文ID(贷记到@VonC)

4) Set the context id in the WizardPage (credit goes to @VonC)

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

这篇关于Eclipse上下文帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆