【问题标题】:How to redefine help listener for StructuredTextEditor如何重新定义 StructuredTextEditor 的帮助侦听器
【发布时间】:2015-09-30 07:08:20
【问题描述】:

我们正在开发 Eclipse 插件项目。我们使用 StructuredTextEditor 来显示 XML 数据。现在我们正在通过标准的 Eclipse 帮助系统集成我们的文档。但对于 StructuredTextEditor 它不起作用。 例如:

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

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

【问题讨论】:

    标签: xml eclipse-plugin text-editor eclipse-pde help-system


    【解决方案1】:

    对于文本编辑器,只需调用 setHelpContextId 方法来设置帮助上下文 ID。

    请注意,StructuredTextEditorinitializeEditor 方法中设置了帮助 ID,因此您必须在此之后设置您的 ID,也许通过覆盖该方法:

    @Override
    protected void initializeEditor()
    {
      super.initializeEditor();
    
      // Set after 'super' call
      setHelpContextId("your id");
    }
    

    【讨论】:

      猜你喜欢
      • 2021-09-22
      • 2010-09-16
      • 1970-01-01
      • 1970-01-01
      • 2015-07-12
      • 1970-01-01
      • 2019-02-04
      • 1970-01-01
      • 2011-01-21
      相关资源
      最近更新 更多