Package bm.ui.def.view.menu

Examples of bm.ui.def.view.menu.MenuItemDef


        int iconIndex = 0;
        for( int i = 0; i < count; i++ )
        {
            boolean active = true;
//            final String fix = name + "." + i;
            final MenuItemDef itemDef = (MenuItemDef) items.elementAt( i );
            if( itemDef.getOnlyIf() != null )
            {
                active = ViewFactory.hasFlag( itemDef.getOnlyIf() );
            }
            else if( itemDef.getUnless() != null )
            {
                active = !ViewFactory.hasFlag( itemDef.getUnless() );
            }
            final int icon = iconIndex++;
            final int selectedIcon = iconIndex++;
            if( active )
            {
                menu.addItem(
                        itemDef.getTitle(),
                        itemDef.getIconIndex() != null ?
                            itemDef.getIconIndex().intValue() :
                            icon,
                        itemDef.getSelectedIconIndex() != null ?
                            itemDef.getSelectedIconIndex().intValue() :
                            selectedIcon,
                        itemDef.getAction(),
                        itemDef.getHelp(),
                        itemDef.getView()
                );
            }
        }
        menuView.helpId = menuDef.getHelpId();
        return menuView;
View Full Code Here


                    count
            );
        }
        for( int i = 0; i < count; i++ )
        {
            final MenuItemDef item = (MenuItemDef) items.elementAt( i );
            boolean active = true;
            final String fix = name + "." + i;
            if( item.getOnlyIf() != null )
            {
                active = ViewFactory.flags.contains( item.getOnlyIf() );
            }
            else if( item.getUnless() != null )
            {
                active = !ViewFactory.flags.contains( item.getUnless() );
            }
            if( active )
            {
                final String text = ResourceManager.getResource(
                        item.getTitle()
                );
                if( hasImageMap )
                {
                    menu.addOption(
                            text,
                            (Image) images.get( fix ),
                            item.getAction()
                    );
                }
                else
                {
                    menu.addOption( text, item.getAction() );
                }
            }
        }
        menu.helpId = menuDef.getHelpId();
        return menu;
View Full Code Here

TOP

Related Classes of bm.ui.def.view.menu.MenuItemDef

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.