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

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


            "}");
    assertHierarchy(
        "{RootLayoutPanel.get()} {local-unique: rootPanel} {/RootLayoutPanel.get()/ /rootPanel.add(panel)/}",
        "  {new: com.google.gwt.user.client.ui.DockLayoutPanel} {local-unique: panel} {/new DockLayoutPanel(Unit.PX)/ /rootPanel.add(panel)/}");
    frame.refresh();
    DockLayoutPanelInfo 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_parse_this() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 2.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    // bounds
    assertEquals(new Rectangle(0, 0, 450, 300), panel.getBounds());
    {
      WidgetInfo button = getJavaInfoByName("button");
      Rectangle bounds = button.getBounds();
      int widthGreatThat =
          Expectations.get(75, new IntValue[]{new IntValue("flanker-windows", 70)});
      assertThat(bounds.width).isGreaterThan(widthGreatThat);
      assertThat(bounds.height).isEqualTo(300);
    }
    // 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

            "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
            "  }",
            "}");
    frame.refresh();
    //
    DockLayoutPanelInfo panel = createJavaInfo("com.google.gwt.user.client.ui.DockLayoutPanel");
    frame.command_CREATE2(panel, null);
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootLayoutPanel rootPanel = RootLayoutPanel.get();",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * When "Unit" is changing, we should change size values accordingly.
   */
  public void test_propertyUnit_changeHorizontal() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 2.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    //
    Property unitProperty = panel.getPropertyByTitle("Unit");
    setPropertyText(unitProperty, "MM");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.MM);",
View Full Code Here

  /**
   * When "Unit" is changing, we should change size values accordingly.
   */
  public void test_propertyUnit_changeVertical() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.MM);",
            "    {",
            "      Button button = new Button();",
            "      addNorth(button, 25.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    //
    Property unitProperty = panel.getPropertyByTitle("Unit");
    setPropertyText(unitProperty, "CM");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link DockLayoutPanelInfo#getEdge(WidgetInfo)}.
   */
  public void test_getEdge() 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, 1.0);",
            "    }",
            "    {",
            "      Button button_3 = new Button();",
            "      addEast(button_3, 1.0);",
            "    }",
            "    {",
            "      Button button_4 = new Button();",
            "      addSouth(button_4, 1.0);",
            "    }",
            "    {",
            "      Button button_5 = new Button();",
            "      add(button_5);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    {
      WidgetInfo button_1 = getJavaInfoByName("button_1");
      assertEquals("WEST", panel.getEdge(button_1));
      assertTrue(panel.isHorizontalEdge(button_1));
      assertFalse(panel.isVerticalEdge(button_1));
    }
    {
      WidgetInfo button_2 = getJavaInfoByName("button_2");
      assertEquals("NORTH", panel.getEdge(button_2));
      assertFalse(panel.isHorizontalEdge(button_2));
      assertTrue(panel.isVerticalEdge(button_2));
    }
    {
      WidgetInfo button_3 = getJavaInfoByName("button_3");
      assertEquals("EAST", panel.getEdge(button_3));
      assertTrue(panel.isHorizontalEdge(button_3));
      assertFalse(panel.isVerticalEdge(button_3));
    }
    {
      WidgetInfo button_4 = getJavaInfoByName("button_4");
      assertEquals("SOUTH", panel.getEdge(button_4));
      assertFalse(panel.isHorizontalEdge(button_4));
      assertTrue(panel.isVerticalEdge(button_4));
    }
    {
      WidgetInfo button_5 = getJavaInfoByName("button_5");
      assertEquals("CENTER", panel.getEdge(button_5));
      assertFalse(panel.isHorizontalEdge(button_5));
      assertFalse(panel.isVerticalEdge(button_5));
    }
  }
View Full Code Here

  /**
   * Test for {@link DockLayoutPanelInfo#setEdge(WidgetInfo, String)}.
   */
  public void test_setEdge_betweenSides() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 1.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    panel.setEdge(button, "NORTH");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
        "    {",
        "      Button button = new Button();",
        "      addNorth(button, 1.0);",
        "    }",
        "  }",
        "}");
    assertEquals("NORTH", panel.getEdge(button));
  }
View Full Code Here

  /**
   * Test for {@link DockLayoutPanelInfo#setEdge(WidgetInfo, String)}.
   */
  public void test_setEdge_sideToCenter() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.CM);",
            "    {",
            "      Button button = new Button();",
            "      addWest(button, 1.0);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    panel.setEdge(button, "CENTER");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
        "    {",
        "      Button button = new Button();",
        "      add(button);",
        "    }",
        "  }",
        "}");
    assertEquals("CENTER", panel.getEdge(button));
  }
View Full Code Here

  /**
   * Test for {@link DockLayoutPanelInfo#setEdge(WidgetInfo, String)}.
   */
  public void test_setEdge_centerToSide() throws Exception {
    DockLayoutPanelInfo panel =
        parseJavaInfo(
            "public class Test extends DockLayoutPanel {",
            "  public Test() {",
            "    super(Unit.MM);",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    WidgetInfo button = getJavaInfoByName("button");
    //
    panel.setEdge(button, "WEST");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.MM);",
        "    {",
        "      Button button = new Button();",
        "      addWest(button, 10.0);",
        "    }",
        "  }",
        "}");
    assertEquals("WEST", panel.getEdge(button));
  }
View Full Code Here

        "}");
    assertEquals("WEST", panel.getEdge(button));
  }

  public void test_setEdge_whenHasCenter_alreadyBeforeCenter() 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();",
            "      addEast(button_2, 1.0);",
            "    }",
            "    {",
            "      Button center = new Button();",
            "      add(center);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    //
    WidgetInfo button = getJavaInfoByName("button_1");
    panel.setEdge(button, "NORTH");
    assertEditor(
        "public class Test extends DockLayoutPanel {",
        "  public Test() {",
        "    super(Unit.CM);",
        "    {",
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.