Menu Designer

When a new project is created, the structure of its main menu is stored in the menu.xml file. Studio provides a visual designer to configure the main menu.

This feature requires a RAD or Enterprise subscription. If you don’t have the subscription, see how to get the trial version.

An easy way to access the structure of the main menu is to double-click the Main Menu subsection in Jmix Tool Window.

menu open

On the Structure tab, you can view and configure the menu while the Text contains the XML code.

menu designer

In the visual designer, you can just drag menu items in the tree to change their location in the menu structure.

By default, the Composite mode is selected. It means the menu contains items from menu.xml of the application, and all included add-ons as well as inherited from the framework. The inherited menu items can not be edited.

menu composite

When you are switching from Composite mode to Single mode, Studio suggests you retain menu items inherited from the framework and add-ons:

menu suggest

In the Single mode, Studio provides the ability to add inherited menu items from the add-ons included in the project. All available items are always displayed in the separate panel on the left, and you can easily drag-and-drop them into your current custom menu.

menu single

If you decide to retain inherited menu items, their structure will be copied to your project, and you will be able to customize them. If later you decide to switch the main menu back to the composite mode, note that you will need to manually remove all duplicated menus and items from your project’s configuration. Otherwise, the menu would become broken as the menu structure doesn’t allow duplicated items.

Adding Menu Items

To add a menu item, click the plus button in the designer. The Create Menu Item window will be opened.

menu create item

You can create the following types of menu items:

  • View - a menu item that opens an application view.

  • Menu - a menu item that contains other items. Detailed information on the menu attributes is available in MenuConfig.

  • Bean - a menu item that invokes a method of a managed bean.

  • Separator - a horizontal line separating menu items.

For more information on how to use View, and Bean types of menu items, see the Item Attributes subsection of MenuConfig.

After the menu item for opening a view is created, it is available to configure a set of properties to pass to the view’s public setters.