gpt4 book ai didi

java - Eclipse插件: Add new menu into SVN > Team pop-up menu

转载 作者:行者123 更新时间:2023-12-01 13:41:13 25 4
gpt4 key购买 nike

我正在开发一个 Eclipse 插件。我想在 Eclipse 的 SVN 插件现有菜单中添加新的附加菜单(右键单击项目名称并从弹出窗口中选择“团队”菜单时出现)

这是我的plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension point = "org.eclipse.ui.popupMenus">
<objectContribution id="com.company.svn.checkout" objectClass="org.eclipse.core.resources.IProject">
<menu
id="com.company.svn.checkout.CheckoutProjectStructure"
label="Team"
path="additions">
<separator name="group1"/>
</menu>
<action id="com.company.svn.checkout.submenu.CheckoutProjectStructure"
label="Update Project Data"
icon="icons/renameProject.png"
menubarPath="com.company.svn.checkout.CheckoutProjectStructure/group1"
helpContextId="com.company.svn.checkout.CheckoutProjectStructure"
class="com.company.svn.checkout.UpdateProjectDataDelegate"
enablesFor="1">
</action>
</objectContribution>
</extension>

但它只是添加了新的单独菜单,并且弹出窗口中有两个菜单“团队”。如何将它们“合并”到 1 个菜单中?

最佳答案

您需要在menubarPath中指定现有的team.main菜单

例如 SVN 操作之一:

<objectContribution
adaptable="true"
objectClass="org.eclipse.core.resources.IProject"
id="org.eclipse.team.svn.ui.ConnectedProjectContributions">

<action
label="%DisconnectAction.label"
helpContextId="org.eclipse.team.svn.ui.team_disconnect_action_context"
class="org.eclipse.team.svn.ui.action.local.management.DisconnectAction"
tooltip="%DisconnectAction.tooltip"
menubarPath="team.main/projectGroup"
definitionId="org.eclipse.team.svn.ui.command.DisconnectCommand"
id="org.eclipse.team.svn.ui.action.local.management.DisconnectAction">
</action>

</objectContribution>

关于java - Eclipse插件: Add new menu into SVN > Team pop-up menu,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20757792/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com