The standard menu creates and configures the menu and toolbar automatically. It adds default menus like File, Edit, Help and default menu items like Login/Logout, Exit, About. All application workscreens will be added by the application to the menu. Every workscreen has its own menu item and/or toolbar button.
The menu forwards most actions to the application because the application is responsible for the security and workscreen management.
If you don't like the standard menu handling or layout, it's very easy to replace the standard menu with your own implementation.
Extending the Menu
The menu class defines default methods that are used by the application, so it's important to extend the class. The class has a constructor with the application as parameter. The constructor delegates the configuration to the method.
protectedvoid configureApplication()
Override this method if your application should get a custom style. The default implementation sets an UIBorderLayout for the application pane and adds the content pane to the application pane with CENTER constraint.
It's possible to add the content pane to your hierarchy (e.g., a tabset) and use a different layout for the application pane. There aren't any limits.
The createStandardMenu method will be called by the application after menu creation. It recreates the whole menu and adds only standard items. It doesn't add any workscreens. The standard menu contains File, Edit and About menus and toolbar buttons. The standard toolbar contains Exit, Login/Logout and Save, Reload (if connected).
The method delegates the creation of the menubar to the method:
protectedvoid createStandardMenuBar()
and toolbar creation to
protectedvoid createStandardToolBar()
Simply override createStandardToolBar and don't call the parent method to hide the toolbar.
The workscreen items will be added by the application after successful login. The method:
The method returns all mapped items for the given ID. Sometimes an ID maps multiple items because one item is the menu item and another one is the toolbar button.
If you add custom items to the menu, simply map them with
public IComponent[] put(String pId, IComponent... pComponent)