Package com.foreach.across.modules.web.menu

Examples of com.foreach.across.modules.web.menu.Menu.addItem()


    menu.addItem( subMenu );

    menu.addItem( "/bbb", "bbb" );

    Menu other = new Menu( "/ccc", "ccc" );
    other.addItem( "ddd", "fff" );
    other.addItem( "eee", "eee" );
    other.addItem( "fff", "ddd" );
    menu.addItem( other );

    menu.setComparator(
View Full Code Here


    menu.addItem( "/bbb", "bbb" );

    Menu other = new Menu( "/ccc", "ccc" );
    other.addItem( "ddd", "fff" );
    other.addItem( "eee", "eee" );
    other.addItem( "fff", "ddd" );
    menu.addItem( other );

    menu.setComparator(
        new FixedMenuOrderComparator( MenuMatchers.pathEquals( "/bbb" ), MenuMatchers.pathMatches( "^/c" ),
View Full Code Here

    menu.addItem( "/bbb", "bbb" );

    Menu other = new Menu( "/ccc", "ccc" );
    other.addItem( "ddd", "fff" );
    other.addItem( "eee", "eee" );
    other.addItem( "fff", "ddd" );
    menu.addItem( other );

    menu.setComparator(
        new FixedMenuOrderComparator( MenuMatchers.pathEquals( "/bbb" ), MenuMatchers.pathMatches( "^/c" ),
                                      MenuMatchers.pathMatches( ".*a.*" ), MenuMatchers.pathEquals( "333" ),
View Full Code Here

    assertEquals( 2, subItem2.getLevel() );
    assertEquals( 3, subSubItem1.getLevel() );
    assertEquals( 3, subSubItem2.getLevel() );

    Menu newRoot = new Menu();
    newRoot.addItem( menu );
    assertEquals( Menu.ROOT_LEVEL, newRoot.getLevel() );
    assertEquals( 1, menu.getLevel() );
    assertEquals( 2, item1.getLevel() );
    assertEquals( 2, item2.getLevel() );
    assertEquals( 3, subItem1.getLevel() );
View Full Code Here

    Menu otherMenu = new Menu();
    boolean failed = false;

    try {
      otherMenu.addItem( item );
    }
    catch ( RuntimeException rte ) {
      failed = true;
    }
View Full Code Here

    Menu otherMenu = new Menu();
    boolean failed = false;

    try {
      otherMenu.addItem( subSub );
    }
    catch ( RuntimeException rte ) {
      failed = true;
    }
View Full Code Here

    }

    assertTrue( failed );

    menu.remove( subSub );
    otherMenu.addItem( subSub );

    assertTrue( subSub.hasParent() );
    assertSame( otherMenu, subSub.getParent() );
  }
View Full Code Here

  }

  @Test
  public void childItemMeansParentIsSelected() {
    Menu menu = new Menu();
    menu.addItem( "path1" );

    Menu item = menu.addItem( "path2" );
    item.addItem( "sub1" );
    Menu subItem = item.addItem( "sub2" );
View Full Code Here

  public void childItemMeansParentIsSelected() {
    Menu menu = new Menu();
    menu.addItem( "path1" );

    Menu item = menu.addItem( "path2" );
    item.addItem( "sub1" );
    Menu subItem = item.addItem( "sub2" );

    subItem.addItem( "subsub1" ).setSelected( true );
    subItem.addItem( "subsub2" );
View Full Code Here

    Menu item = menu.addItem( "path2" );
    item.addItem( "sub1" );
    Menu subItem = item.addItem( "sub2" );

    subItem.addItem( "subsub1" ).setSelected( true );
    subItem.addItem( "subsub2" );

    assertFalse( menu.getItem( Menu.byPath( "path1" ) ).isSelected() );
    assertTrue( menu.getItemWithPath( "path2" ).isSelected() );
    assertFalse( menu.getItemWithPath( "sub1" ).isSelected() );
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.