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

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


  /**
   * Test for {@link DockLayoutPanelInfo#setReasonableSize(WidgetInfo)}.
   */
  public void test_setReasonableSize_CM() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 0.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    panel.setReasonableSize(button);
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
        "    {",
View Full Code Here


  /**
   * Test for {@link DockLayoutPanelInfo#setReasonableSize(WidgetInfo)}.
   */
  public void test_setReasonableSize_MM() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.MM);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 0.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    panel.setReasonableSize(button);
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.MM);",
        "    {",
View Full Code Here

  /**
   * Test for {@link DockLayoutPanelInfo#setReasonableSize(WidgetInfo)}.
   */
  public void test_setReasonableSize_IN() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.IN);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 0.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    panel.setReasonableSize(button);
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.IN);",
        "    {",
View Full Code Here

  /**
   * Test for {@link DockLayoutPanelInfo#getReasonableSize(WidgetInfo)}.
   */
  public void test_getReasonableSize_PT() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.PT);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 0.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    double size =
        (Double) ReflectionUtils.invokeMethod(
            panel,
View Full Code Here

  //
  // Commands
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "  }",
            "}");
    panel.refresh();
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    panel.setEdge(newButton, "WEST");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
        "    {",
View Full Code Here

  /**
   * New widget should be added before CENTER, but after other edges.
   */
  public void test_CREATE_whenHasCenter() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "    {",
            "      Button east = new Button();",
            "      addWest(east, 1.0);",
            "    }",
            "    {",
            "      Button center = new Button();",
            "      add(center);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    //
    WidgetInfo newButton = createButton();
    panel.command_CREATE2(newButton, null);
    panel.setEdge(newButton, "WEST");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
        "    {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_MOVE() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "    {",
            "      Button button_1 = new Button();",
            "      addWest(button_1, 1.0);",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      addNorth(button_2, 2.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    //
    panel.command_MOVE2(button_2, button_1);
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
        "    {",
View Full Code Here

            "  }",
            "}");
    frame.refresh();
    //
    {
      DockLayoutPanelInfo panel = getJavaInfoByName("panel");
      doCopyPaste(panel, new PasteProcedure<WidgetInfo>() {
        public void run(WidgetInfo copy) throws Exception {
          frame.command_CREATE2(copy, null);
        }
      });
View Full Code Here

            "}");
    assertHierarchy(
        "{RootLayoutPanel.get()} {local-unique: rootPanel} {/RootLayoutPanel.get()/ /rootPanel.add(panel)/}",
        "  {new: com.google.gwt.user.client.ui.SplitLayoutPanel} {local-unique: panel} {/new SplitLayoutPanel()/ /rootPanel.add(panel)/}");
    frame.refresh();
    DockLayoutPanelInfo panel = getJavaInfoByName("panel");
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    // no Unit property
    {
      GenericProperty unitProperty = (GenericProperty) panel.getPropertyByTitle("Unit");
      assertNull(unitProperty);
    }
  }
View Full Code Here

      assertNull(unitProperty);
    }
  }

  public void test_parse_this() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends SplitLayoutPanel {",
            "  public Test() {",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 200.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    {
      WidgetInfo button = getJavaInfoByName("button");
      Rectangle bounds = button.getBounds();
      assertThat(bounds.width).isEqualTo(200);
      assertThat(bounds.height).isEqualTo(300);
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.DockLayoutPanelInfo

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.