Eclipse中“活动帮助”页面中的启动向导 [英] Launch wizard from Active Help page in Eclipse
问题描述
我正在创建一个RCP应用程序,并想使用Eclipse帮助内容(帮助>帮助内容
)提供文档,我设法通过添加一些页面使用扩展点 org.eclipse.help.toc
可以正常工作,但是我有兴趣在其中一个页面中提供链接以启动向导,我发现Eclipse使用称为活动帮助。
I'm creating an RCP application and wanted to provide documentation using the Eclipse Help Contents (Help > Help Contents
), I managed to add some pages to it by using the extension point org.eclipse.help.toc
, this works fine, but I'm interested in providing a link in one of those pages to launch a wizard, I found that Eclipse provides support for this using a feature called Active Help.
首先,在我的html帮助页面中,导入了 livehelp.js
脚本:
First, in my html Help page I have imported the livehelp.js
script:
<head>
...
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js"></script>
<head>
然后在< body>
中添加了链接:
<a href='javascript:liveAction("com.test.my.plugin", "com.test.my.plugin.actions.TestAction", "")'>Execute action</a>
最后,这是我的 TestAction
类:
public class TestAction implements ILiveHelpAction {
@Override
public void run() {
System.out.println("Action executed");
// code to launch wizard is here
}
@Override
public void setInitializationString(String str) {
}
}
但是当单击链接时,该操作未执行,我尝试在其中设置断点 run()
方法,但从未调用过,不知道为什么会这样吗?
But when the link is clicked the action is not executed, I tried setting a breakpoint in the run()
method but it is never called, any idea why this is happening?
推荐答案
我遇到了完全相同的问题。但是我想我做错了:我将插件手动复制到eclipse / plugins目录。
I had exactly the same problem. But I think I was doing something wrong: I was copying my plugin manually into eclipse/plugins directory.
我尝试了正确的插件分发机制:
I tried with a "correct" plugin distribution mechanisms:
- 功能插件
- 更新站点插件
- 标准从eclipse实例中安装,菜单help->安装新软件
现在一切正常,我的操作正常了。
And now things are working... my action gets called normally..
这篇关于Eclipse中“活动帮助”页面中的启动向导的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!