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

Examples of com.google.gdt.eclipse.designer.gwtext.model.widgets.PanelInfo


  /**
   * Test for {@link TableLayoutInfo#command_normalizeSpanning()}.<br>
   * Single control spanned on two rows.
   */
  public void test_normalizeSpanning_2() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(1));",
            "    {",
            "      Button button = new Button('0');",
            "      TableLayoutData tableLayoutData = new TableLayoutData(1);",
            "      tableLayoutData.setRowspan(2);",
            "      add(button, tableLayoutData);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    //
    layout.command_normalizeSpanning();
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
View Full Code Here


  /**
   * Test for {@link TableLayoutInfo#command_normalizeSpanning()}.<br>
   * No normalize: each column/row has control.
   */
  public void test_normalizeSpanning_3() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(2));",
            "    {",
            "      Button button = new Button('0');",
            "      add(button, new TableLayoutData(2));",
            "    }",
            "    add(new Label());",
            "    {",
            "      Button button = new Button('1');",
            "      add(button);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    //
    layout.command_normalizeSpanning();
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
View Full Code Here

  /**
   * Test for {@link TableLayoutInfo#command_normalizeSpanning()}.<br>
   * Do normalize: no control for second column.
   */
  public void test_normalizeSpanning_4() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(2));",
            "    {",
            "      Button button = new Button('0');",
            "      add(button, new TableLayoutData(2));",
            "    }",
            "    {",
            "      Button button = new Button('1');",
            "      add(button);",
            "    }",
            "    add(new Label());",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    //
    layout.command_normalizeSpanning();
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
View Full Code Here

  //
  // MOVE
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_MOVE() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(2));",
            "    {",
            "      Button button = new Button('0');",
            "      add(button);",
            "    }",
            "    add(new Label());",
            "    {",
            "      Button button = new Button('1');",
            "      add(button);",
            "    }",
            "    {",
            "      Button button = new Button('2');",
            "      add(button);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    WidgetInfo button = panel.getChildrenWidgets().get(2);
    //
    layout.command_MOVE(button, 1, false, 0, false);
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_MOVE_out() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(1));",
            "    {",
            "      Panel composite = new Panel();",
            "      add(composite);",
            "    }",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    PanelInfo composite = (PanelInfo) panel.getChildrenWidgets().get(0);
    LayoutInfo layout = composite.getLayout();
    WidgetInfo button = panel.getChildrenWidgets().get(1);
    //
    layout.command_MOVE(button, null);
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
View Full Code Here

        "  }",
        "}");
  }

  public void test_MOVE_error_1() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(4));",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    WidgetInfo button = panel.getChildrenWidgets().get(7);
    //
    layout.command_MOVE(button, 1, false, 0, false);
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
View Full Code Here

        "  }",
        "}");
  }

  public void test_MOVE_error_2() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(3));",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    add(new Label());",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    WidgetInfo button = panel.getChildrenWidgets().get(5);
    //
    layout.command_MOVE(button, 0, false, 0, false);
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
View Full Code Here

  //
  // ADD
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_ADD() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(1));",
            "    {",
            "      Panel composite = new Panel();",
            "      {",
            "        Button button = new Button();",
            "        composite.add(button);",
            "      }",
            "      add(composite);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    PanelInfo composite = (PanelInfo) panel.getChildrenWidgets().get(0);
    WidgetInfo button = composite.getChildrenWidgets().get(0);
    //
    layout.command_ADD(button, 0, false, 1, false);
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
View Full Code Here

  /**
   * Test that when delete {@link TableLayoutInfo}, fillers are also removed, because there are not
   * controls that user wants.
   */
  public void test_DELETE_removeFillers() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "import com.google.gwt.user.client.ui.Button;",
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new TableLayout(1));",
            "    add(new Label());",
            "    {",
            "      Button button = new Button();",
            "      add(button);",
            "    }",
            "  }",
            "}");
    panel.refresh();
    TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
    // initially 2 controls - filler and Button
    assertThat(panel.getChildrenWidgets()).hasSize(2);
    // after delete - only Button
    layout.delete();
    assertThat(panel.getChildrenWidgets()).hasSize(1);
    assertEditor(
        "import com.google.gwt.user.client.ui.Button;",
        "public class Test extends Panel {",
        "  public Test() {",
        "    {",
View Full Code Here

  //
  // Tests
  //
  ////////////////////////////////////////////////////////////////////////////
  public void test_parse() throws Exception {
    PanelInfo panel =
        parseJavaInfo(
            "public class Test extends Panel {",
            "  public Test() {",
            "    setLayout(new RowLayout());",
            "    {",
            "      PagingToolbar toolbar = new PagingToolbar(new SimpleStore('field', new Object[]{}));",
            "      add(toolbar);",
            "    }",
            "  }",
            "}");
    assertHierarchy(
        "{this: com.gwtext.client.widgets.Panel} {this} {/setLayout(new RowLayout())/ /add(toolbar)/}",
        "  {new: com.gwtext.client.widgets.layout.RowLayout} {empty} {/setLayout(new RowLayout())/}",
        "  {new: com.gwtext.client.widgets.PagingToolbar} {local-unique: toolbar} {/new PagingToolbar(new SimpleStore('field', new Object[]{}))/ /add(toolbar)/}",
        "    {virtual-layout_data: com.gwtext.client.widgets.layout.RowLayoutData} {virtual-layout-data} {}");
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here

TOP

Related Classes of com.google.gdt.eclipse.designer.gwtext.model.widgets.PanelInfo

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.