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

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.StackLayoutPanelInfo$WidgetHandle


            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // Unit property
    {
      GenericProperty unitProperty = (GenericProperty) panel.getPropertyByTitle("Unit");
      assertNotNull(unitProperty);
      {
        Class<?> type = unitProperty.getType();
        assertNotNull(type);
        assertEquals("com.google.gwt.dom.client.Style$Unit", type.getName());
View Full Code Here


      assertEquals("PX", getPropertyText(unitProperty));
    }
  }

  public void test_parseEmpty_this() throws Exception {
    StackLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends StackLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "  }",
            "}");
    panel.refresh();
    assertNoErrors(panel);
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // Unit property
    {
      GenericProperty unitProperty = (GenericProperty) panel.getPropertyByTitle("Unit");
      assertNotNull(unitProperty);
      {
        Class<?> type = unitProperty.getType();
        assertNotNull(type);
        assertEquals("com.google.gwt.dom.client.Style$Unit", type.getName());
View Full Code Here

   * Test for {@link StackPanelInfo#getWidgetHandles()}.
   * <p>
   * No widgets, no {@link WidgetHandle}'s.
   */
  public void test_WidgetHandle_empty() throws Exception {
    StackLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends StackLayoutPanel {",
            "  public Test() {",
            "    super(Unit.EM);",
            "  }",
            "}");
    panel.refresh();
    assertTrue(panel.getWidgetHandles().isEmpty());
  }
View Full Code Here

   * Test for {@link StackPanelInfo#getWidgetHandles()}.
   * <p>
   * {@link WidgetHandle}'s should have some good bounds.
   */
  public void test_WidgetHandle_getBounds() throws Exception {
    StackLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends StackLayoutPanel {",
            "  public Test() {",
            "    super(Unit.EM);",
            "    {",
            "      Button button_1 = new Button();",
            "      add(button_1, new HTML('First widget'), 1.0);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      add(button_2, new HTML('Second widget'), 1.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    //
    List<WidgetHandle> handles = panel.getWidgetHandles();
    assertThat(handles).hasSize(2);
    {
      WidgetHandle handle = handles.get(0);
      assertSame(button_1, handle.getWidget());
      Rectangle bounds = handle.getBounds();
View Full Code Here

        "      panel.setSize('250px', '200px');",
        "    }",
        "  }",
        "}");
    refresh();
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    List<WidgetHandle> handles = panel.getWidgetHandles();
    assertThat(handles).hasSize(1);
    {
      WidgetHandle handle = handles.get(0);
      Rectangle bounds = handle.getBounds();
      assertThat(bounds.x).isEqualTo(0);
View Full Code Here

  /**
   * Test for {@link AbstractWidgetHandle#show()}.
   */
  public void test_WidgetHandle_show() throws Exception {
    StackLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends StackLayoutPanel {",
            "  public Test() {",
            "    super(Unit.EM);",
            "    {",
            "      Button button_1 = new Button();",
            "      add(button_1, new HTML('First widget'), 1.0);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      add(button_2, new HTML('Second widget'), 1.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    assertTrue(isVisible(button_1));
    assertFalse(isVisible(button_2));
    //
    panel.getWidgetHandles().get(1).show();
    assertFalse(isVisible(button_1));
    assertTrue(isVisible(button_2));
  }
View Full Code Here

    assertFalse(isVisible(button_1));
    assertTrue(isVisible(button_2));
  }

  public void test_HeaderText_property() throws Exception {
    StackLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends StackLayoutPanel {",
            "  public Test() {",
            "    super(Unit.EM);",
            "    {",
            "      Button button = new Button();",
            "      add(button, new HTML('My widget'), 1.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    Property property = button.getPropertyByTitle("HeaderText");
    assertNotNull(property);
    assertTrue(property.getCategory().isSystem());
View Full Code Here

  //
  // Commands
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE_this() throws Exception {
    StackLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends StackLayoutPanel {",
            "  public Test() {",
            "    super(Unit.EM);",
            "  }",
            "}");
    panel.refresh();
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    assertEditor(
        "public class Test extends StackLayoutPanel {",
        "  public Test() {",
        "    super(Unit.EM);",
        "    {",
View Full Code Here

            "    StackLayoutPanel panel = new StackLayoutPanel(Unit.EM);",
            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    StackLayoutPanel panel = new StackLayoutPanel(Unit.EM);",
View Full Code Here

            "      rootPanel.add(button);",
            "    }",
            "  }",
            "}");
    frame.refresh();
    StackLayoutPanelInfo panel = getJavaInfoByName("panel");
    //
    WidgetInfo button = getJavaInfoByName("button");
    panel.command_MOVE2(button, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
        "    {",
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.StackLayoutPanelInfo$WidgetHandle

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.