Examples of PopupPanelInfo


Examples of com.google.gdt.eclipse.designer.model.widgets.panels.PopupPanelInfo

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_filled() throws Exception {
    PopupPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DialogBox {",
            "  public Test() {",
            "    setText('DialogBox');",
            "    {",
            "      Button button = new Button();",
            "      setWidget(button);",
            "      button.setPixelSize(300, 200);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.DialogBox} {this} {/setText('DialogBox')/ /setWidget(button)/}",
        "  {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /setWidget(button)/ /button.setPixelSize(300, 200)/}");
    WidgetInfo button = panel.getWidget();
    // do refresh()
    panel.refresh();
    assertFalse(panel.isEmpty());
    // check DialogBox bounds
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.x).isEqualTo(0);
      assertThat(bounds.y).isEqualTo(0);
      assertThat(bounds.width).isEqualTo(300);
      assertThat(bounds.height).isGreaterThan(200 + 20);
    }
    {
      Image image = panel.getImage();
      assertNotNull(image);
    }
    // check Button bounds
    {
      Rectangle bounds = button.getBounds();
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.PopupPanelInfo

      assertThat(bounds.height).isEqualTo(200);
    }
  }

  public void test_empty() throws Exception {
    PopupPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DialogBox {",
            "  public Test() {",
            "    setText('DialogBox');",
            "  }",
            "}");
    // do refresh()
    panel.refresh();
    assertTrue(panel.isEmpty());
    assertNull(panel.getWidget());
    // check DialogBox bounds
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.x).isEqualTo(0);
      assertThat(bounds.y).isEqualTo(0);
      assertThat(bounds.width).isGreaterThan(110);
      assertThat(bounds.height).isGreaterThan(40);
    }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.PopupPanelInfo

      assertThat(bounds.height).isGreaterThan(40);
    }
  }

  public void test_setSize() throws Exception {
    PopupPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DialogBox {",
            "  public Test() {",
            "    setText('DialogBox');",
            "    {",
            "      Button button = new Button();",
            "      setWidget(button);",
            "      button.setPixelSize(150, 100);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // check initial size
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.width).isGreaterThanOrEqualTo(150);
      assertThat(bounds.height).isGreaterThanOrEqualTo(100);
    }
    // set new size
    panel.getTopBoundsSupport().setSize(300, 200);
    panel.refresh();
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.width).isEqualTo(300);
      assertThat(bounds.height).isEqualTo(200);
    }
    assertEditor(
        "public class Test extends DialogBox {",
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.PopupPanelInfo

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_filled() throws Exception {
    PopupPanelInfo panel =
        parseJavaInfo(
            "public class Test extends PopupPanel {",
            "  public Test() {",
            "    {",
            "      Button button = new Button();",
            "      setWidget(button);",
            "      button.setPixelSize(450, 300);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.google.gwt.user.client.ui.PopupPanel} {this} {/setWidget(button)/}",
        "  {new: com.google.gwt.user.client.ui.Button} {local-unique: button} {/new Button()/ /setWidget(button)/ /button.setPixelSize(450, 300)/}");
    WidgetInfo button = panel.getWidget();
    // do refresh()
    panel.refresh();
    assertFalse(panel.isEmpty());
    // check PopupPanel bounds
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.x).isEqualTo(0);
      assertThat(bounds.y).isEqualTo(0);
      assertThat(bounds.width).isEqualTo(450);
      assertThat(bounds.height).isEqualTo(304);
    }
    {
      Image image = panel.getImage();
      assertNotNull(image);
      assertThat(image.getBounds().width).isEqualTo(450);
      assertThat(image.getBounds().height).isEqualTo(304);
    }
    // check Button bounds
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.PopupPanelInfo

      assertEquals(new Rectangle(0, 0, 450, 300), bounds);
    }
  }

  public void test_empty() throws Exception {
    PopupPanelInfo panel =
        parseJavaInfo(
            "// filler filler filler",
            "public class Test extends PopupPanel {",
            "  public Test() {",
            "  }",
            "}");
    assertHierarchy("{this: com.google.gwt.user.client.ui.PopupPanel} {this} {}");
    // do refresh()
    panel.refresh();
    assertTrue(panel.isEmpty());
    assertNull(panel.getWidget());
  }
View Full Code Here

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.PopupPanelInfo

    assertTrue(panel.isEmpty());
    assertNull(panel.getWidget());
  }

  public void test_setSize() throws Exception {
    PopupPanelInfo panel =
        parseJavaInfo(
            "public class Test extends PopupPanel {",
            "  public Test() {",
            "    {",
            "      Button button = new Button();",
            "      setWidget(button);",
            "      button.setPixelSize(150, 100);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // check initial size
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.width).isGreaterThanOrEqualTo(150);
      assertThat(bounds.height).isGreaterThanOrEqualTo(100);
    }
    // set new size
    panel.getTopBoundsSupport().setSize(300, 200);
    panel.refresh();
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.width).isGreaterThanOrEqualTo(300);
      assertThat(bounds.height).isGreaterThanOrEqualTo(200);
    }
    assertEditor(
        "public class Test extends PopupPanel {",
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.