简体   繁体   English

如何从netBeans平台的菜单中删除项目?

[英]How to remove items from menu in netBeans platform?

I have module application. 我有模块应用程序。 When I run it, the main window of that app has quite complex menu. 当我运行它时,该应用程序的主窗口具有相当复杂的菜单。 How to remove some items from menu? 如何从菜单中删除一些项目?

You can remove menu items from the menu bar by adding entries to your project's layer.xml file. 您可以通过向项目的layer.xml文件添加条目来从菜单栏中删除菜单项。

You should read through 'Tweaking the User Interface' from the 'NetBeans Platform HTML Editor' tutorial to get a rough idea of what you will need to do. 您应该阅读“NetBeans平台HTML编辑器”教程中的“调整用户界面”,以大致了解您需要做什么。

There is another tutorial-ish description of using the layer file to hide items , too. 还有另一个使用图层文件来隐藏项目的教程描述

In netbeans 8.0 , the layer file is generated when ever a module contains 'configuration type' annonations in java code, for example a module with top component. 在netbeans 8.0中,当模块在java代码中包含“配置类型”声明时生成层文件,例如具有顶部组件的模块。 The generated layer.xml is located at build directory classes/META-INF/generated-layer.xml. 生成的layer.xml位于构建目录类/ META-INF / generated-layer.xml中。 However, the generated-layer.xml is not editable. 但是,generated-layer.xml不可编辑。 To hide/show menubar / tool bar, click on the module, click other and add XML layer file. 要隐藏/显示菜单栏/工具栏,请单击该模块,单击其他并添加XML图层文件。 Now under the important files you can see XML layer. 现在在重要文件下你可以看到XML层。 Expand it. 展开它。 Now expand . 现在扩大。 Expand the "Menu Bar". 展开“菜单栏”。 Delete the menu bar which you don't want. 删除您不想要的菜单栏。

The easier way appears to be, as Martin Krauskopf wrote: 正如马丁·克拉斯科普夫写道:

Just go to: 只是去:

Projects view (Ctrl-1) >> your module >> Important Files >> XML Layer >> 项目视图(Ctrl-1) >> 您的模块 >> 重要文件 >> XML层 >> Menu Bar >> Help 菜单栏 >> 帮助

and delete what you want (it will actually generate appropriate content in layer.xml of the module). 并删除你想要的东西(它实际上会在模块的layer.xml中生成适当的内容)。

You can remove it in layer.xml 您可以在layer.xml中删除它

layer in context - Menu Bar 上下文中的图层 - 菜单栏

here's the link 这是链接

http://platform.netbeans.org/tutorials/nbm-htmleditor.html http://platform.netbeans.org/tutorials/nbm-htmleditor.html

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

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