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

Examples of com.google.gdt.eclipse.designer.uibinder.model.widgets.WidgetInfo


        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    //
    call_expose(button, "text", "buttonText", true);
    assertXML(
        "// filler filler filler filler filler",
        "<ui:UiBinder>",
View Full Code Here


        "<ui:UiBinder>",
        "  <g:FlowPanel>",
        "    <g:Button wbp:name='button'/>",
        "  </g:FlowPanel>",
        "</ui:UiBinder>");
    WidgetInfo button = getObjectByName("button");
    assertNotNull(button);
    // prepare action
    final IAction action = getExposeAction(button, "text");
    // animate
    new UiContext().executeAndCheck(new UIRunnable() {
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for parsing @UiChild annotations into {@link Position}s.
   */
  public void test_positions() throws Exception {
    WidgetInfo container =
        parse(
            "// filler filler filler filler filler",
            "// filler filler filler filler filler",
            "<ui:UiBinder>",
            "  <t:MyContainer>",
            "    <t:topbutton>",
            "      <g:Button wbp:name='button_1' text='1'/>",
            "    </t:topbutton>",
            "    <t:topbutton text='B'>",
            "      <g:Button wbp:name='button_2' text='2'/>",
            "    </t:topbutton>",
            "    <t:bottomWidget>",
            "      <g:TextBox wbp:name='textBox'/>",
            "    </t:bottomWidget>",
            "  </t:MyContainer>",
            "</ui:UiBinder>");
    assertHierarchy(
        "// filler filler filler filler filler",
        "// filler filler filler filler filler",
        "<t:MyContainer>",
        "  <g:Button wbp:name='button_1' text='1'>",
        "  <g:Button wbp:name='button_2' text='2'>",
        "  <g:TextBox wbp:name='textBox'>");
    refresh();
    WidgetInfo button_1 = getObjectByName("button_1");
    WidgetInfo button_2 = getObjectByName("button_2");
    WidgetInfo textBox = getObjectByName("textBox");
    // check Button's text
    assertEquals("1", ReflectionUtils.invokeMethod(button_1.getObject(), "getText()"));
    assertEquals("B", ReflectionUtils.invokeMethod(button_2.getObject(), "getText()"));
    // "container" children are Position-s
    List<ObjectInfo> containerChildren = container.getPresentation().getChildrenTree();
View Full Code Here

  /**
   * Test for {@link Position#canAddChild()}.
   */
  public void test_canAddChild() throws Exception {
    WidgetInfo container =
        parse(
            "// filler filler filler filler filler",
            "// filler filler filler filler filler",
            "<ui:UiBinder>",
            "  <t:MyContainer>",
            "    <t:topbutton>",
            "      <g:Button wbp:name='button_1' text='1'/>",
            "    </t:topbutton>",
            "    <t:topbutton>",
            "      <g:Button wbp:name='button_2' text='2'/>",
            "    </t:topbutton>",
            "    <t:topbutton>",
            "      <g:Button wbp:name='button_3' text='3'/>",
            "    </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

        "      <g:Button wbp:name='button'/>",
        "    </t:bottomWidget>",
        "  </t:MyContainer>",
        "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    // no "UiChild" property
    {
      Property uiChildProperty = PropertyUtils.getByPath(button, "UiChild");
      assertNull(uiChildProperty);
    }
View Full Code Here

        "      <g:Button wbp:name='button'/>",
        "    </t:topbutton>",
        "  </t:MyContainer>",
        "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    // has "UiChild" property
    {
      Property uiChildProperty = PropertyUtils.getByPath(button, "UiChild");
      assertNotNull(uiChildProperty);
      Property[] childProperties = PropertyUtils.getChildren(uiChildProperty);
View Full Code Here

        "      <g:Button wbp:name='button'/>",
        "    </t:topbutton>",
        "  </t:MyContainer>",
        "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    // no "UiChild" property
    {
      Property uiChildProperty = PropertyUtils.getByPath(button, "UiChild");
      assertNull(uiChildProperty);
    }
View Full Code Here

            "    <parameter name='UiChild.disabled'>true</parameter>",
            "  </parameters>",
            "</component>"));
    waitForAutoBuild();
    // parse
    WidgetInfo container =
        parse(
            "// filler filler filler filler filler",
            "<ui:UiBinder>",
            "  <t:MyContainer>",
            "    <t:topbutton>",
            "      <g:Button wbp:name='button'/>",
            "    </t:topbutton>",
            "  </t:MyContainer>",
            "</ui:UiBinder>");
    refresh();
    WidgetInfo button = getObjectByName("button");
    // no "UiChild" property
    {
      Property uiChildProperty = PropertyUtils.getByPath(button, "UiChild");
      assertNull(uiChildProperty);
    }
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link Position#command_CREATE(WidgetInfo, WidgetInfo)}.
   */
  public void test_CREATE() throws Exception {
    WidgetInfo container =
        parse(
            "// filler filler filler filler filler",
            "<ui:UiBinder>",
            "  <t:MyContainer>",
            "    <t:topbutton>",
            "      <g:Button wbp:name='button'/>",
            "    </t:topbutton>",
            "  </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>",
View Full Code Here

  /**
   * Test for {@link Position#command_MOVE(WidgetInfo, WidgetInfo)}.
   */
  public void test_MOVE_reorder() throws Exception {
    WidgetInfo container =
        parse(
            "<ui:UiBinder>",
            "  <t:MyContainer>",
            "    <t:topbutton>",
            "      <g:Button wbp:name='button_1' text='1'/>",
            "    </t:topbutton>",
            "    <t:topbutton text='B'>",
            "      <g:Button wbp:name='button_2' text='2'/>",
            "    </t:topbutton>",
            "  </t:MyContainer>",
            "</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>",
View Full Code Here

TOP

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

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.