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

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.grid.CellConstraintsSupport$SetVerticalAlignmentAction


    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    // prepare new Button, associate it with "panel"
    WidgetInfo newButton = createButton();
    panel.addChild(newButton);
    // check CellConstraintsSupport
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(newButton);
    assertEquals(-1, constraints.getX());
    assertEquals(-1, constraints.getY());
    assertEquals(1, constraints.getWidth());
    assertEquals(1, constraints.getHeight());
  }
View Full Code Here


    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    // check CellConstraintsSupport
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
    assertEquals(2, constraints.getX());
    assertEquals(1, constraints.getY());
    assertEquals(1, constraints.getWidth());
    assertEquals(1, constraints.getHeight());
  }
View Full Code Here

    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
    assertSame(expectedAlignment, constraints.getHorizontalAlignment());
  }
View Full Code Here

    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo button = panel.getChildrenWidgets().get(0);
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
        constraints.setHorizontalAlignment(alignment);
      }
    });
    //
    String expectedSource =
        getTestSource(
View Full Code Here

    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo button = panel.getChildrenWidgets().get(0);
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
        constraints.setHorizontalAlignment(ColumnInfo.Alignment.RIGHT);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
View Full Code Here

    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
    assertSame(expectedAlignment, constraints.getVerticalAlignment());
  }
View Full Code Here

    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
    assertSame(ColumnInfo.Alignment.LEFT, constraints.getHorizontalAlignment());
    assertSame(RowInfo.Alignment.TOP, constraints.getVerticalAlignment());
  }
View Full Code Here

            "  }",
            "}");
    refresh();
    //
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
    // FILL initially
    {
      ColumnInfo.Alignment alignment = constraints.getHorizontalAlignment();
      assertSame(ColumnInfo.Alignment.FILL, alignment);
      // check properties
      assertNotNull(alignment.getSmallImage());
      assertNotNull(alignment.getMenuImage());
      assertEquals("N/A", alignment.getAlignmentField());
      assertEquals("N/A", alignment.getAlignmentString());
    }
    // set RIGHT, removes "width=100%"
    setHorizontalAlignment(button, ColumnInfo.Alignment.RIGHT);
    assertEditor(
        "public class Test extends FlexTable {",
        "  public Test() {",
        "    Button button = new Button('A');",
        "    setWidget(0, 0, button);",
        "    getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);",
        "  }",
        "}");
    // set "width=150px" and LEFT, keep "width=150px"
    button.getSizeSupport().setSize("150px", null);
    setHorizontalAlignment(button, ColumnInfo.Alignment.LEFT);
    assertEditor(
        "public class Test extends FlexTable {",
        "  public Test() {",
        "    Button button = new Button('A');",
        "    setWidget(0, 0, button);",
        "    button.setWidth('150px');",
        "    getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);",
        "  }",
        "}");
    // set FILL
    setHorizontalAlignment(button, ColumnInfo.Alignment.FILL);
    assertSame(ColumnInfo.Alignment.FILL, constraints.getHorizontalAlignment());
    assertEditor(
        "public class Test extends FlexTable {",
        "  public Test() {",
        "    Button button = new Button('A');",
        "    setWidget(0, 0, button);",
View Full Code Here

            "  }",
            "}");
    refresh();
    //
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(button);
    // FILL initially
    {
      RowInfo.Alignment alignment = constraints.getVerticalAlignment();
      assertSame(RowInfo.Alignment.FILL, alignment);
      // check properties
      assertNotNull(alignment.getSmallImage());
      assertNotNull(alignment.getMenuImage());
      assertEquals("N/A", alignment.getAlignmentField());
      assertEquals("N/A", alignment.getAlignmentString());
    }
    // set BOTTOM, removes "height=100%"
    setVerticalAlignment(button, RowInfo.Alignment.BOTTOM);
    assertEditor(
        "public class Test extends FlexTable {",
        "  public Test() {",
        "    Button button = new Button('A');",
        "    setWidget(0, 0, button);",
        "    getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_BOTTOM);",
        "  }",
        "}");
    // set "height=150px" and TOP, keep "height=150px"
    button.getSizeSupport().setSize(null, "150px");
    setVerticalAlignment(button, RowInfo.Alignment.TOP);
    assertEditor(
        "public class Test extends FlexTable {",
        "  public Test() {",
        "    Button button = new Button('A');",
        "    setWidget(0, 0, button);",
        "    button.setHeight('150px');",
        "    getCellFormatter().setVerticalAlignment(0, 0, HasVerticalAlignment.ALIGN_TOP);",
        "  }",
        "}");
    // set FILL
    setVerticalAlignment(button, RowInfo.Alignment.FILL);
    assertSame(RowInfo.Alignment.FILL, constraints.getVerticalAlignment());
    assertEditor(
        "public class Test extends FlexTable {",
        "  public Test() {",
        "    Button button = new Button('A');",
        "    setWidget(0, 0, button);",
View Full Code Here

  private static void setHorizontalAlignment(final WidgetInfo widget,
      final ColumnInfo.Alignment alignment) {
    ExecutionUtils.run(widget, new RunnableEx() {
      @Override
      public void run() throws Exception {
        CellConstraintsSupport constraints = HTMLTableInfo.getConstraints(widget);
        constraints.setHorizontalAlignment(alignment);
      }
    });
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.model.widgets.panels.grid.CellConstraintsSupport$SetVerticalAlignmentAction

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.