简体   繁体   English

NetBeans RCP中的“移动IDE日志”菜单项

[英]Moving IDE Log menu item in NetBeans RCP

我们如何将NetBeans RCP的菜单项“ IDE Log”从“查看”菜单移至其他菜单?

Hiding existing menu 隐藏现有菜单

  1. Use the layer.xml file (add if not there) and _hidden suffix to hide the required menu 使用layer.xml文件(如果不存在则添加)和_hidden后缀隐藏所需的菜单
  2. Refer the answer https://stackoverflow.com/a/10291239/446251 for detailed explanation 请参阅答案https://stackoverflow.com/a/10291239/446251了解详细说明

Adding menu like existing menu 像现有菜单一样添加菜单

  1. Note the action class for the current menu in the layer file 注意图层文件中当前菜单的动作类
  2. Add your own menu where needed and set the action class to the earlier noted action 在需要的地方添加自己的菜单,并将操作类设置为前面提到的操作

Example Layer file 示例图层文件

<filesystem>
<folder name="Menu">
    <folder name="View">
        <file name="Separator2.instance_hidden"/>
        <file name="org-netbeans-core-actions-LogAction.shadow_hidden"/>
    </folder>
    <folder name="Other">
        <file name="org-netbeans-core-actions-LogAction.shadow">
            <!--org.netbeans.core.actions.LogAction-->
            <attr name="originalFile" stringvalue="Actions/View/org-netbeans-core-actions-LogAction.instance"/>
            <attr intvalue="500" name="position"/>
        </file>
    </folder>
</folder>
</filesystem>

Example Project code You can check the bare minimum NetBeans Platform application here https://archive.org/download/application1_201601/application1.zip 示例项目代码您可以在这里检查最低限度的NetBeans Platform应用程序:https://archive.org/download/application1_201601/application1.zip

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM