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

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.grid.HTMLTableInfo


            "    rootPanel.add(panel);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(0);
    assertThat(panel.getRows()).hasSize(0);
    assertEquals("0 0 [] {}", panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo newButton = createButton();
        panel.command_CREATE(newButton, 0, false, 0, false);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    FlexTable panel = new FlexTable();",
        "    rootPanel.add(panel);",
        "    {",
        "      Button button = new Button();",
        "      panel.setWidget(0, 0, button);",
        "    }",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(1);
    assertThat(panel.getRows()).hasSize(1);
    assertEquals("1 1 [1] {(0,0)=(1,1)}", panel.getStatus().toString());
  }
View Full Code Here


            "    panel.setWidget(1, 0, new Button('A'));",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(1);
    assertThat(panel.getRows()).hasSize(2);
    assertEquals("1 2 [1, 1] {(0,0)=(1,1) (0,1)=(1,1)}", panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo newButton = createButton();
        panel.command_CREATE(newButton, 1, false, 0, false);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    FlexTable panel = new FlexTable();",
        "    rootPanel.add(panel);",
        "    {",
        "      Button button = new Button();",
        "      panel.setWidget(0, 1, button);",
        "    }",
        "    panel.setWidget(1, 0, new Button('A'));",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(2);
    assertThat(panel.getRows()).hasSize(2);
    assertEquals(
        "2 2 [2, 2] {(0,0)=(1,1) (1,0)=(1,1) (0,1)=(1,1) (1,1)=(1,1)}",
        panel.getStatus().toString());
  }
View Full Code Here

            "    panel.getRowFormatter().setStyleName(0, 'A');",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(2);
    assertThat(panel.getRows()).hasSize(1);
    assertEquals("2 1 [2] {(0,0)=(1,1) (1,0)=(1,1)}", panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        panel.insertColumn(1);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    FlexTable panel = new FlexTable();",
        "    rootPanel.add(panel);",
        "    panel.setWidget(0, 0, new Button('A'));",
        "    panel.setWidget(0, 2, new Button('B'));",
        "    panel.getCellFormatter().setWidth(0, 0, '10px');",
        "    panel.getCellFormatter().setWidth(0, 2, '20px');",
        "    panel.getFlexCellFormatter().setColSpan(0, 0, 1);",
        "    panel.getFlexCellFormatter().setColSpan(0, 2, 1);",
        "    panel.getColumnFormatter().setWidth(0, '100px');",
        "    panel.getColumnFormatter().setWidth(2, '200px');",
        "    panel.getRowFormatter().setStyleName(0, 'A');",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(3);
    assertThat(panel.getRows()).hasSize(1);
    assertEquals("3 1 [3] {(0,0)=(1,1) (1,0)=(1,1) (2,0)=(1,1)}", panel.getStatus().toString());
  }
View Full Code Here

            "    panel.getFlexCellFormatter().setColSpan(1, 1, 2);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(3);
    assertThat(panel.getRows()).hasSize(3);
    assertEquals("3 3 [3, 2, 3] {"
        + "(0,0)=(1,1) (1,0)=(1,1) (2,0)=(1,1) "
        + "(0,1)=(1,1) (1,1)=(2,1) "
        + "(0,2)=(1,1) (1,2)=(1,1) (2,2)=(1,1)}", panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        panel.insertColumn(2);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    FlexTable panel = new FlexTable();",
        "    rootPanel.add(panel);",
        "    panel.setWidget(0, 0, new Button('A'));",
        "    panel.setWidget(1, 1, new Button('B'));",
        "    panel.setWidget(2, 3, new Button('C'));",
        "    panel.getFlexCellFormatter().setColSpan(1, 1, 3);",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(4);
    assertThat(panel.getRows()).hasSize(3);
    assertEquals("4 3 [4, 2, 4] {"
        + "(0,0)=(1,1) (1,0)=(1,1) (2,0)=(1,1) (3,0)=(1,1) "
        + "(0,1)=(1,1) (1,1)=(3,1) "
        + "(0,2)=(1,1) (1,2)=(1,1) (2,2)=(1,1) (3,2)=(1,1)}", panel.getStatus().toString());
  }
View Full Code Here

            "    }",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(1);
    assertThat(panel.getRows()).hasSize(1);
    assertEquals("1 1 [1] {(0,0)=(1,1)}", panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        panel.deleteColumn(0);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    FlexTable panel = new FlexTable();",
        "    rootPanel.add(panel);",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(0);
    assertThat(panel.getRows()).hasSize(0);
    assertEquals("0 0 [] {}", panel.getStatus().toString());
  }
View Full Code Here

            "    panel.setWidget(1, 1, new Button('B'));",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    assertThat(panel.getRows()).hasSize(2);
    assertEquals(0, panel.getRows().get(0).getIndex());
    assertEquals(1, panel.getRows().get(1).getIndex());
  }
View Full Code Here

            "    panel.setWidget(1, 1, new Button('B'));",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    assertThat(panel.getRows()).hasSize(2);
    assertEquals(false, panel.getRows().get(0).isLast());
    assertEquals(true, panel.getRows().get(1).isLast());
  }
View Full Code Here

            "    panel.setWidget(2, 0, new Button('B'));",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    assertThat(panel.getRows()).hasSize(3);
    assertFalse(panel.getRows().get(0).isEmpty());
    assertTrue(panel.getRows().get(1).isEmpty());
    assertFalse(panel.getRows().get(2).isEmpty());
  }
View Full Code Here

            "    panel.getRowFormatter().setVerticalAlign(1, HasVerticalAlignment.ALIGN_BOTTOM);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    assertThat(panel.getRows()).hasSize(2);
    assertEquals(RowInfo.Alignment.TOP, panel.getRows().get(0).getAlignment());
    assertEquals(RowInfo.Alignment.BOTTOM, panel.getRows().get(1).getAlignment());
  }
View Full Code Here

            setAlignmentLine,
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    //
    assertThat(panel.getRows()).hasSize(1);
    assertEquals(expectedAlignment, panel.getRows().get(0).getAlignment());
  }
View Full Code Here

TOP

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

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.