Recipe 13: Customize the menu and the toolbar(s)
How can I customize the menu and the toolbar(s) of my RCP application?
Each module contains a
layer.xml file which is something like a registry of the module. It contains information about the windows, menus, toolbars, actions etc. of the module. The RCP combines all
layer.xml files of all modules to create the final application layout. Without getting into too much detail, you can display
layer.xml of a module by right-clicking on it and selecting: New | Other | Module Development | XML Layer. Then, if you expand the Imporant Files menu you see an XML Layer node which contains two subnodes: <this layer> and <this layer in context>. The first contains the menus, actions etc. of the current module (local registry) while the second is the global registry (of the application).
By right clicking, e.g. on a menu item, you have actions like Delete, Rename, New etc. which you can use to customise the menus according to your needs. Similar case for toolbars, actions etc.