Trace: Flatten Menu


Flatten Menu

Usually, the corporation menu items will be shown in groups (e.g. MDM, Admin):

The menu bar contains menus with menu items, for each screen, e.g., the menu Admin contains Statistic and Company screen.

But, sometimes, you want flat menus, e.g.,

This can be done with your own Menu implementation, e.g.,

public class FlatMenuBarCorporation extends WebMenuCorporation 
    public FlatMenuBarCorporation(IApplication pApplication) 
    protected IMenuItem addMenuItem(String pId,
                                    String pGroupId,
                                    String pAction, 
                                    String pActionCommand,
                                    String pGroup,
                                    String pGroupImage, 
                                    String pShortcut,
                                    String pText, 
                                    String pImage,
                                    boolean pUseSeparator,
                                    boolean pToggle)
        if ("Admin".equals(pGroup))
            UIMenuBar bar = getMenuBar();
            UIMenuItem miItem = createMenuItem(pAction, pActionCommand, pText, UIImage.getImage(pImage));
            return miItem;
            return super.addMenuItem(pId, pGroupId, pAction, pActionCommand, pGroup, 
                                     pGroupImage, pShortcut, pText, pImage, pUseSeparator, pToggle);

To use the custom menu, simply change the corporation menu class name in your deployment descriptor, e.g.,


In newer versions, it's possible to set:

  <!-- comma separated list of group names -->

instead of your custom menu implementation.

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information