Hiding Unwanted Menus and Toolbars

See Also

You can hide unwanted menus and toolbars, or items within them, from a standalone application by creating a branding layer.xml file in a specific location within the module suite folder structure.

To hide unwanted menus and toolbars:

  1. Right-click a module suite project and choose Properties.
  2. In the Project Properties dialog box, click Application.
  3. Select the Create Standalone Application checkbox.
  4. Optionally, brand the application and create a splash screen. Click OK.
  5. In the Files window (Ctrl-2), expand the branding folder until you reach the windows folder:
    branding/modules/org-netbeans-core-window.jar/org/netbeans/core/windows
  6. Right-click the windows folder, choose New > File/Folder, and select Folder in the Other category. Click Next and name the folder resources. Click Finish.
  7. Right-click the new resources node, choose New > File/Folder, and select XML Document in the XML category. Click Next. Name the file layer. Click Next and then click Finish.
  8. Replace the default content of the new layer.xml file with tags for the folders and files that you want to hide. Each folder or file that you want to hide is suffixed with the text _hidden. For example, this branding layer.xml file hides the File toolbar, the Edit toolbar, items within the File menu, and the complete Edit menu:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" 
           "http://www.netbeans.org/dtds/filesystem-1_1.dtd">
    <filesystem>
    
        <!-- hide unused toolbars -->
        <folder name="Toolbars">
            <folder name="File_hidden"/>
            <folder name="Edit_hidden"/>
        </folder>
    
        <folder name="Menu">
            <folder name="File">
                <file name="org-openide-actions-SaveAction.instance_hidden"/>
                <file name="org-openide-actions-SaveAllAction.instance_hidden"/>
                <file name="org-netbeans-core-actionsRefreshAllFilesystemsAction.instance_hidden"/>
                <file name="org-openide-actions-PageSetupAction.instance_hidden"/>
                <file name="org-openide-actions-PrintAction.instance_hidden"/>
            </folder>
            <folder name="Edit_hidden"/>
        </folder>
    
    </filesystem>
See Also
About NetBeans Platform and Module Development
About the NetBeans Platform

Legal Notices