Package com.google.gdt.eclipse.designer.uibinder.model.util.UiChildSupport

Examples of com.google.gdt.eclipse.designer.uibinder.model.util.UiChildSupport.Position


            "    </t:topbutton>",
            "  </t:MyContainer>",
            "</ui:UiBinder>");
    refresh();
    WidgetInfo button_3 = getObjectByName("button_3");
    Position position = getPosition(container, "topbutton");
    // has 3 buttons, can not add more
    assertFalse(position.canAddChild());
    // delete "button_3", can add new one
    button_3.delete();
    assertTrue(position.canAddChild());
  }
View Full Code Here


            "  </t:MyContainer>",
            "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    // do create
    Position position = getPosition(container, "topbutton");
    WidgetInfo newButton = createButton();
    position.command_CREATE(newButton, button);
    assertXML(
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
        "  <t:MyContainer>",
        "    <t:topbutton>",
View Full Code Here

            "</ui:UiBinder>");
    refresh();
    WidgetInfo button_1 = getObjectByName("button_1");
    WidgetInfo button_2 = getObjectByName("button_2");
    // do move
    Position position = getPosition(container, "topbutton");
    position.command_MOVE(button_2, button_1);
    assertXML(
        "<ui:UiBinder>",
        "  <t:MyContainer>",
        "    <t:topbutton text='B'>",
        "      <g:Button wbp:name='button_2' text='2'/>",
View Full Code Here

            "  </t:MyContainer>",
            "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    // do move
    Position position = getPosition(container, "bottomWidget");
    position.command_MOVE(button, null);
    assertXML(
        "<ui:UiBinder>",
        "  <t:MyContainer>",
        "    <t:bottomWidget>",
        "      <g:Button wbp:name='button'/>",
View Full Code Here

   */
  static Position getPosition(WidgetInfo container, String tag) throws Exception {
    List<ObjectInfo> containerChildren = container.getPresentation().getChildrenTree();
    for (ObjectInfo child : containerChildren) {
      if (child instanceof Position) {
        Position position = (Position) child;
        if (position.getTag().equals(tag)) {
          return position;
        }
      }
    }
    throw new AssertionFailedError("Can not find Position " + tag);
View Full Code Here

            "    <t:topbutton>",
            "      <g:Button wbp:name='button' text='Existing'/>",
            "    </t:topbutton>",
            "  </t:MyContainer>",
            "</ui:UiBinder>");
    Position position = UiChildTest.getPosition(container, "topbutton");
    WidgetInfo button = getObjectByName("button");
    // try Label, no command
    {
      loadCreationTool("com.google.gwt.user.client.ui.Label");
      tree.moveOn(position);
View Full Code Here

            "    <t:topbutton>",
            "      <g:Button text='Button 3'/>",
            "    </t:topbutton>",
            "  </t:MyContainer>",
            "</ui:UiBinder>");
    Position position = UiChildTest.getPosition(container, "topbutton");
    // create Button, but container already full
    loadButton();
    tree.moveOn(position).assertCommandNull();
  }
View Full Code Here

            "    <t:topbutton>",
            "      <g:Button wbp:name='button' text='Button'/>",
            "    </t:topbutton>",
            "  </t:MyContainer>",
            "</ui:UiBinder>");
    Position position = UiChildTest.getPosition(container, "topbutton");
    WidgetInfo button = getObjectByName("button");
    //
    doCopyPaste(button);
    tree.moveOn(position).assertCommandNotNull();
    tree.click();
View Full Code Here

        "    <t:MyContainer wbp:name='container'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    WidgetInfo container = getObjectByName("container");
    Position position = UiChildTest.getPosition(container, "topbutton");
    //
    tree.startDrag(button).dragOn(position).endDrag();
    assertXML(
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
View Full Code Here

    // "container" children are Position-s
    List<ObjectInfo> containerChildren = container.getPresentation().getChildrenTree();
    assertThat(containerChildren).hasSize(2);
    // "bottom" position
    {
      Position position = (Position) containerChildren.get(0);
      assertEquals(
          "com.google.gwt.user.client.ui.Widget",
          position.getWidgetClass().getCanonicalName());
      // presentation
      IObjectPresentation presentation = position.getPresentation();
      assertEquals("bottomWidget", presentation.getText());
      assertNotNull(presentation.getIcon());
      // tree children
      List<ObjectInfo> positionChildren = position.getPresentation().getChildrenTree();
      assertThat(positionChildren).containsExactly(textBox);
    }
    // "top" position
    {
      Position position = (Position) containerChildren.get(1);
      assertEquals(
          "com.google.gwt.user.client.ui.Button",
          position.getWidgetClass().getCanonicalName());
      // presentation
      IObjectPresentation presentation = position.getPresentation();
      assertEquals("topbutton", presentation.getText());
      assertNotNull(presentation.getIcon());
      // tree children
      List<ObjectInfo> positionChildren = position.getPresentation().getChildrenTree();
      assertThat(positionChildren).containsExactly(button_1, button_2);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.uibinder.model.util.UiChildSupport.Position

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.