【发布时间】:2013-08-06 07:33:20
【问题描述】:
我创建了一个插件,可以在现有菜单中添加一个菜单(使用 Hello, World 命令)
当我在测试时运行它时,运行时运行时-EclipseApplication 已创建,我可以看到菜单和命令。但是当我从导出向导安装它时,我看不到菜单。
没有可调试此问题的日志。
我已经安装了相同类型的插件(使用 Hello, World 命令)。这会导致任何问题
这是plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<category
name="Sample Category"
id="CheckList.commands.category">
</category>
<command
name="Create Checklist"
categoryId="CheckList.commands.category"
id="CheckList.commands.sampleCommand">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="CheckList.commands.sampleCommand"
class="checklist.handlers.createChecklistHandler">
</handler>
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="CheckList.commands.sampleCommand"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+8"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu?after=additions">
<menu
label="Create Checklist"
mnemonic="M"
id="CheckList.menus.sampleMenu">
<command
commandId="CheckList.commands.sampleCommand"
mnemonic="C"
id="CheckList.menus.sampleCommand">
</command>
</menu>
</menuContribution>
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar
id="CheckList.toolbars.sampleToolbar">
<command
commandId="CheckList.commands.sampleCommand"
icon="icons/sample.gif"
tooltip="Create migration Checklist"
id="CheckList.toolbars.sampleCommand">
</command>
</toolbar>
</menuContribution>
</extension>
</plugin>
【问题讨论】:
-
您是否使用了另一个已安装的插件名称?
-
@scawf no.. 我用了不同的名字
-
您应该尝试为菜单使用不同的 id