Package gov.nasa.arc.mct.gui

Examples of gov.nasa.arc.mct.gui.MenuSection


           
            if (menu.canHandle(context)) {
                int lastPopulatedIndex = -1;
                List<MenuSection> sections = menu.getMenuSections();
                for (int sectionIndex = 0; sectionIndex < sections.size(); sectionIndex++) {
                    MenuSection section = sections.get(sectionIndex);
                    List<MenuItemInfo> menuItemInfoList = section.getMenuItemInfoList();
                   
                    for (MenuItemInfo info : menuItemInfoList) {
                        MenuItemType type = info.getType();
                        if (type == MenuItemType.SUBMENU) {
                            ContextAwareMenu submenu = ActionManager.getMenu(info.getCommandKey(), context);
View Full Code Here


                }

                lastPopulatedIndex = -1;
                List<MenuSection> sections = menu.getMenuSections();
                for (int index = 0; index < sections.size(); index++) {
                    MenuSection section = sections.get(index);
                    List<MenuItemInfo> menuItemInfoList = section.getMenuItemInfoList();
                   
                    for (MenuItemInfo info : menuItemInfoList) {
                        MenuItemType type = info.getType();
                        if (type == MenuItemType.SUBMENU) {
                            ContextAwareMenu submenu = ActionManager.getMenu(info.getCommandKey(), context);
View Full Code Here

    List<MenuSection> sections = testMenu.getMenuSections();
   
    Assert.assertNotNull(sections);
    Assert.assertEquals(sections.size(), 2);
   
      MenuSection allSection = sections.get(0);
      List<MenuItemInfo> allMenus = allSection.getMenuItemInfoList();
      Assert.assertNotNull(allMenus);
      Assert.assertEquals(allMenus.size(), 5);

      MenuItemInfo info = allMenus.get(0);
      Assert.assertEquals(info.getCommandKey(), DO_THIS);
      
        info = allMenus.get(1);
        Assert.assertEquals(info.getCommandKey(), DO_THAT);
     
        info = allMenus.get(2);
        Assert.assertEquals(info.getCommandKey(), DO_THESE);

        info = allMenus.get(3);
        Assert.assertEquals(info.getCommandKey(), DONT_DO_THIS_YET);

        info = allMenus.get(4);
        Assert.assertEquals(info.getCommandKey(), TEST_SUBMENU);

       
      MenuSection additionsSection = sections.get(1);
      List<MenuItemInfo> addtionsMenus = additionsSection.getMenuItemInfoList();
     
        info = addtionsMenus.get(0);
        Assert.assertEquals(info.getCommandKey(), DO_EXTRA);
  }
View Full Code Here

       
        // Should have multiple sections (quit should be in its own)
        Assert.assertTrue(menuSections.size() > 1);
       
        // Quit should be at the bottom of the last section
        MenuSection lastSection = menuSections.get(menuSections.size() - 1);
        List<MenuItemInfo> infos = lastSection.getMenuItemInfoList();
        MenuItemInfo lastMenuItem = infos.get(infos.size() - 1);
        Assert.assertTrue(lastMenuItem.getCommandKey().equals("QUIT_ACTION"));
    }
View Full Code Here

TOP

Related Classes of gov.nasa.arc.mct.gui.MenuSection

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.