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

Examples of com.google.gdt.eclipse.designer.gxt.model.widgets.LayoutContainerInfo


  //
  // command_BOUNDS
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_BOUNDS_setLocation_materialize() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    WidgetInfo button = container.getWidgets().get(0);
    // set location
    layout.command_BOUNDS(button, new Point(1, 2), null);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
View Full Code Here


        "  }",
        "}");
  }

  public void test_BOUNDS_setLocation_update() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button, new AbsoluteData(10, 20));",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    WidgetInfo button = container.getWidgets().get(0);
    // set location
    layout.command_BOUNDS(button, new Point(1, 2), null);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_BOUNDS_setLocation_default() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button, new AbsoluteData(10, 20));",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    WidgetInfo button = container.getWidgets().get(0);
    // set location
    layout.command_BOUNDS(button, new Point(-1, -1), null);
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_BOUNDS_setSize() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    WidgetInfo button = container.getWidgets().get(0);
    // set size
    layout.command_BOUNDS(button, null, new Dimension(100, 50));
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_BOUNDS_setSize_removeAnchor() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      AbsoluteData absoluteData = new AbsoluteData(10, 20);",
            "      absoluteData.setAnchorSpec('50% 20%');",
            "      add(button, absoluteData);",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    WidgetInfo button = container.getWidgets().get(0);
    // set size
    layout.command_BOUNDS(button, null, new Dimension(100, 50));
    assertEditor(
        "public class Test extends LayoutContainer {",
        "  public Test() {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_setAnchor_removeSize() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button, new AbsoluteData(10, 20));",
            "      button.setSize('200px', '100px');",
            "    }",
            "  }",
            "}");
    container.refresh();
    WidgetInfo button = container.getWidgets().get(0);
    AbsoluteDataInfo absoluteData = AbsoluteLayoutInfo.getAbsoluteData(button);
    // set anchor: width
    absoluteData.setAnchorWidth("50%");
    assertEditor(
        "public class Test extends LayoutContainer {",
View Full Code Here

  //
  // command_CREATE
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_CREATE() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    WidgetInfo newButton = createButton();
    // add new Button
    layout.command_CREATE(newButton);
    assertEditor(
        "public class Test extends LayoutContainer {",
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link AbsoluteLayoutAlignmentSupport}.
   */
  public void test_alignmentActions_LEFT() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends LayoutContainer {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button_1 = new Button();",
            "      add(button_1, new AbsoluteData(10, 20));",
            "    }",
            "    {",
            "      Button button_2 = new Button();",
            "      add(button_2, new AbsoluteData(30, 100));",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    setupSelectionActions(layout);
    WidgetInfo button_1 = getJavaInfoByName("button_1");
    WidgetInfo button_2 = getJavaInfoByName("button_2");
    // perform alignment
    alignWidgets("Align left edges", button_1, button_2);
View Full Code Here

  /**
   * Test for {@link AbsoluteLayoutAlignmentSupport}.
   */
  public void test_alignmentActions_centerInWindow() throws Exception {
    LayoutContainerInfo container =
        parseJavaInfo(
            "public class Test extends Dialog {",
            "  public Test() {",
            "    setLayout(new AbsoluteLayout());",
            "    {",
            "      Button button = new Button();",
            "      add(button, new AbsoluteData(10, 20));",
            "      button.setSize(100, 30);",
            "    }",
            "  }",
            "}");
    container.refresh();
    AbsoluteLayoutInfo layout = (AbsoluteLayoutInfo) container.getLayout();
    setupSelectionActions(layout);
    WidgetInfo button = getJavaInfoByName("button");
    // perform alignment
    alignWidgets("Center horizontally in window", button);
    assertEditor(
View Full Code Here

  ////////////////////////////////////////////////////////////////////////////
  public LayoutDataSupport(JavaInfo host) {
    m_host = host;
    m_host.addBroadcastListener(new ObjectInfoTreeComplete() {
      public void invoke() throws Exception {
        LayoutContainerInfo container = getContainer();
        // create virtual LayoutData
        if (isActiveOnContainer(container)) {
          ensureLayoutDatas();
        }
      }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gxt.model.widgets.LayoutContainerInfo

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.