The items available in a standard Lucy are all configured through their configuration files. The configuration files determine in which action bar the item appears.
For example, the action to create a new vertical view is configured as:
As shown in the Menu overview, you can find the Vertical View entry in the menu bar under File → New → Vertical View.
When it inserts the action, the program steps through the path defined in the configuration file to determine to which (sub-)menu the action belongs. If the configured (sub-)menu does not exist yet, it will be created.
In the example, the program:
-
Searches the first level of the menu bar for an entry called
File
. If there is no such entry, it will be created. -
The
File
menu searches for an entryNew
. It will be created if needed. -
The
Vertical View
entry is added to theNew
sub-menu.
See The available action bar configuration options for an overview of all available options. |
Grouping and ordering the action items
Menu entries are created when an action is inserted. Therefore, the order in which they appear depends on the order in which the actions are inserted. This would lead to an unpredictable item order in the action bar.
Grouping menu entries logically
You can prevent an unpredictable order of items by setting the groups
property of the action. It allows you to group menu items. You can group them into functional categories like file management
or printing, for example.
The value of the groups
property is a comma-separated list of the same length as the list in the item
property.
For each item listed in the item
property, the group name is the item at the corresponding index in the group
property.
In case of the vertical view example, the configuration file contains:
TLcyVerticalViewAddOn.addVerticalViewAction.menuBar.item = File, New, Vertical View
TLcyVerticalViewAddOn.addVerticalViewAction.menuBar.groups = FileGroup, NewGroup, NewOtherGroup