Java 如何在eclipse插件中将参数传递到context.xml文件?
我有一个eclipse插件,它有一个扩展名:Java 如何在eclipse插件中将参数传递到context.xml文件?,java,xml,eclipse,eclipse-plugin,Java,Xml,Eclipse,Eclipse Plugin,我有一个eclipse插件,它有一个扩展名: <extension point="org.eclipse.help.contexts"> <contexts file="contexts.xml" plugin="my.plugin.id"> </contexts> </extension> 一切正常,但现在我想向contexts.xml传递一个参数
<extension
point="org.eclipse.help.contexts">
<contexts
file="contexts.xml"
plugin="my.plugin.id">
</contexts>
</extension>
一切正常,但现在我想向contexts.xml传递一个参数,以便在此基础上更改href。 例如,现在它是www.google.com,通过传递参数,我想将其更改为www.yahoo.com,并且我想在java代码中传递参数。 这可能吗?如果是,怎么做?
PS:我不想从用户那里获取输入,而是将信息放在一个变量中,从文件中获取。看起来您希望基于配置文件提供不同搜索引擎的集合 正如“dgolovin”所指出的,“org.eclipse.help.ui.searchEngine”可能具有您想要的功能。自Eclipse3.1以来,您可以在各种风格(本地搜索、信息中心和Web搜索)中定义自己的搜索引擎 我主要看到两种选择:
您可能需要查看org.eclipse.help.ui.searchEngine扩展点,它似乎非常接近您要查找的内容。
<contexts>
<context id="test_context" title="About Contexts">
<description>This is written by me.</description>
<topic href="http://www.google.com" label="Search about me" />
</context>
</contexts>
PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, "my.plugin.id.test_context");