Package com.google.gdt.eclipse.designer.uibinder.model.widgets.menu

Examples of com.google.gdt.eclipse.designer.uibinder.model.widgets.menu.MenuItemInfo


        "<g:FlowPanel>",
        "  <g:MenuBar wbp:name='bar'>",
        "    <g:MenuItem wbp:name='item' text='A'>");
    refresh();
    MenuBarInfo bar = getObjectByName("bar");
    MenuItemInfo item = getObjectByName("item");
    // only item in "bar"
    assertThat(bar.getAllItems()).containsOnly(item);
    // check "text" property
    Property textProperty = item.getPropertyByTitle("text");
    assertEquals("A", textProperty.getValue());
    textProperty.setValue("B");
    assertXML(
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
View Full Code Here


        "<g:FlowPanel>",
        "  <g:MenuBar wbp:name='bar'>",
        "    <g:MenuItem wbp:name='item' text='Sub'>",
        "      <g:MenuBar wbp:name='subMenu'>");
    refresh();
    MenuItemInfo item = getObjectByName("item");
    MenuBarInfo subMenu = getObjectByName("subMenu");
    assertSame(subMenu, item.getSubMenu());
  }
View Full Code Here

        "        <g:MenuItem text='Sub item 1'>",
        "        <g:MenuItem text='Sub item 2'>",
        "    <g:MenuItem text='Separate item'>");
    refresh();
    MenuBarInfo menu = getObjectByName("bar");
    MenuItemInfo item_1 = menu.getItems().get(0);
    MenuItemInfo item_2 = menu.getItems().get(1);
    MenuBarInfo subMenu = item_1.getSubMenu();
    MenuItemInfo subMenuItem_1 = subMenu.getItems().get(0);
    MenuItemInfo subMenuItem_2 = subMenu.getItems().get(1);
    // bad adapters
    {
      assertNull(menu.getAdapter(List.class));
      assertNull(item_1.getAdapter(List.class));
    }
View Full Code Here

    IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
    IMenuPolicy policy = barObject.getPolicy();
    // don't accept something other than MenuItem
    assertFalse(policy.validateCreate(new Object()));
    // create new MenuItem
    MenuItemInfo newItem = createObject("com.google.gwt.user.client.ui.MenuItem");
    assertTrue(policy.validateCreate(newItem));
    policy.commandCreate(newItem, null);
    assertXML(
        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
View Full Code Here

      GenerationSettings generationSettings =
          GwtToolkitDescription.INSTANCE.getGenerationSettings();
      generationSettings.setVariable(FieldInitializerVariableDescription.INSTANCE);
    }
    // create new MenuItem
    MenuItemInfo newItem = createObject("com.google.gwt.user.client.ui.MenuItem", "withSubMenu");
    assertTrue(policy.validateCreate(newItem));
    policy.commandCreate(newItem, null);
    assertXML(
        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
View Full Code Here

    refresh();
    MenuBarInfo bar = getObjectByName("bar");
    // prepare memento
    List<XmlObjectMemento> mementos;
    {
      MenuItemInfo existingItem = getObjectByName("item");
      XmlObjectMemento memento = XmlObjectMemento.createMemento(existingItem);
      mementos = ImmutableList.of(memento);
    }
    // paste new "Item"
    {
View Full Code Here

        "    <g:MenuItem wbp:name='item_1' text='A'>",
        "      <g:MenuBar wbp:name='subMenu_1'>",
        "    <g:MenuItem wbp:name='item_2' text='B'>",
        "      <g:MenuBar wbp:name='subMenu_2'>");
    MenuBarInfo bar = getObjectByName("bar");
    MenuItemInfo item_1 = getObjectByName("item_1");
    MenuItemInfo item_2 = getObjectByName("item_2");
    // can not move "bar" on "subMenu_1"
    {
      MenuBarInfo subMenu_1 = item_1.getSubMenu();
      IMenuInfo subMenuObject_1 = MenuObjectInfoUtils.getMenuInfo(subMenu_1);
      assertFalse(subMenuObject_1.getPolicy().validateMove(bar));
View Full Code Here

        "  <g:MenuBar wbp:name='bar'>",
        "    <g:MenuItem wbp:name='subMenuItem' text='A'>",
        "      <g:MenuBar wbp:name='subMenu'>",
        "    <g:MenuItem wbp:name='separateItem' text='B'>");
    MenuBarInfo subMenu = getObjectByName("subMenu");
    MenuItemInfo separateItem = getObjectByName("separateItem");
    // can reparent "separateItem" to "subMenu"
    IMenuInfo subMenuObject = MenuObjectInfoUtils.getMenuInfo(subMenu);
    assertTrue(subMenuObject.getPolicy().validateMove(separateItem));
    subMenuObject.getPolicy().commandMove(separateItem, null);
    assertXML(
View Full Code Here

        "    <g:MenuBar wbp:name='menuBar'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    MenuBarInfo menuBar = getObjectByName("menuBar");
    //
    MenuItemInfo newItem = loadCreationTool("com.google.gwt.user.client.ui.MenuItem");
    canvas.moveTo(menuBar, 5, 0.5).click();
    assertXML(
        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
View Full Code Here

        "        <g:MenuBar wbp:name='subMenu' vertical='true'/>",
        "      </g:MenuItem>",
        "    </g:MenuBar>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    MenuItemInfo subMenuItem = getObjectByName("subMenuItem");
    MenuBarInfo subMenu = getObjectByName("subMenu");
    //
    loadCreationTool("com.google.gwt.user.client.ui.MenuItem");
    // initially no EditPart for "subMenu"
    canvas.assertNullEditPart(subMenu);
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.uibinder.model.widgets.menu.MenuItemInfo

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.