java - Eclipse RCP - 将子菜单添加到现有文件菜单

标签 java eclipse-plugin eclipse-rcp

我想将子菜单添加到现有文件菜单中。 我尝试如下:

<extension
         point="org.eclipse.ui.menus">
       <menuContribution
            allPopups="false"
            locationURI="menu:org.eclipse.ui.file?after=additions ">
         <command
               commandId="com.my.home.handler.MyHandler"
               id="myTrams"
               label="TRAMS"
               style="push">
         </command>
      </menuContribution>
   </extension>

有人可以帮助使用plugin.xml 将子菜单添加到现有文件菜单吗? 提前致谢。

最佳答案

"file"菜单的菜单 ID 只是 file 而不是“org.eclipse.ui.file”

例如,这是“文件 > 重新启动”的菜单贡献:

<menuContribution
        locationURI="menu:file?after=open.ext">
     <command
           commandId="org.eclipse.ui.file.restartWorkbench"
           id="org.eclipse.ui.file.restartWorkbench"
           style="push">
     </command>
</menuContribution>

关于java - Eclipse RCP - 将子菜单添加到现有文件菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25300098/

相关文章:

java - 如何防止处理程序在应用程序不活动时停止其进程

eclipse - 使用 Eclipse Ganymede : Is there a good plugin available? 对方法进行更细粒度的排序

eclipse-plugin - 如何接收鼠标和键盘事件并覆盖Eclipse ITextEditor的默认行为?

java - E4 EPartService findPart() 抛出 java.lang.Null 指针异常

java - 获取文件名的正则表达式

java - 从 Java 开始忽略/捕获子进程输出的最简单方法

eclipse - 如何在 Eclipse 包资源管理器中更改已修改文件/包的颜色?

java - 在 Eclipse 4.4 RCP 构建中, "The service Plugin converter could not be acquired."

java - 使用 Eclipse RCP 程序打印

JavaMail 无效的 MSGID