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

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


            "    }",
            "  }",
            "}");
    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.deleteRow(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, 0, new Button('B'));",
            "  }",
            "}");
    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 {
        panel.deleteRow(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'));",
        "  }",
        "}");
    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.getRowFormatter().setStyleName(2, 'B');",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(1);
    assertThat(panel.getRows()).hasSize(3);
    assertEquals(
        "1 3 [1, 1, 1] {(0,0)=(1,1) (0,1)=(1,1) (0,2)=(1,1)}",
        panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        panel.deleteRow(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(1, 0, new Button('B'));",
        "    panel.getCellFormatter().setWidth(0, 0, '10px');",
        "    panel.getCellFormatter().setWidth(1, 0, '20px');",
        "    panel.getFlexCellFormatter().setColSpan(0, 0, 1);",
        "    panel.getFlexCellFormatter().setColSpan(1, 0, 1);",
        "    panel.getColumnFormatter().setWidth(0, '100px');",
        "    panel.getRowFormatter().setStyleName(0, 'A');",
        "    panel.getRowFormatter().setStyleName(1, 'B');",
        "  }",
        "}");
    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());
  }
View Full Code Here

            "    panel.getFlexCellFormatter().setRowSpan(1, 1, 3);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(3);
    assertThat(panel.getRows()).hasSize(4);
    assertEquals("3 4 [3, 3, 3, 3] {"
        + "(0,0)=(1,1) (1,0)=(1,1) (2,0)=(1,1) "
        + "(0,1)=(1,1) (1,1)=(1,3) (2,1)=(1,1) "
        + "(0,2)=(1,1) (1,2)=(1,1) (2,2)=(1,1) "
        + "(0,3)=(1,1) (1,3)=(1,1) (2,3)=(1,1)}", panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        panel.deleteRow(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, 2, new Button('C'));",
        "    panel.getFlexCellFormatter().setRowSpan(1, 1, 2);",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(3);
    assertThat(panel.getRows()).hasSize(3);
    assertEquals("3 3 [3, 3, 3] {"
        + "(0,0)=(1,1) (1,0)=(1,1) (2,0)=(1,1) "
        + "(0,1)=(1,1) (1,1)=(1,2) (2,1)=(1,1) "
        + "(0,2)=(1,1) (1,2)=(1,1) (2,2)=(1,1)}", panel.getStatus().toString());
  }
View Full Code Here

            "    panel.getCellFormatter().setWidth(0, 0, '100px');",
            "  }",
            "}");
    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 {
        panel.clearRow(0);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    FlexTable panel = new FlexTable();",
        "    rootPanel.add(panel);",
        "    panel.setWidget(1, 0, new Button('B'));",
        "  }",
        "}");
    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());
  }
View Full Code Here

            "    panel.getCellFormatter().setWidth(1, 0, '100px');",
            "  }",
            "}");
    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 {
        panel.clearRow(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'));",
        "  }",
        "}");
    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.getCellFormatter().setWidth(1, 0, '100px');",
            "  }",
            "}");
    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 {
        panel.clearRow(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'));",
        "  }",
        "}");
    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.setText(1, 0, 'To keep');",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    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());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo buttonA = panel.getChildrenWidgets().get(0);
        assertEquals("0 0 1 1", HTMLTableInfo.getConstraints(buttonA).toString());
        panel.command_CELLS(buttonA, new Rectangle(0, 0, 2, 1));
        assertEquals("0 0 2 1", HTMLTableInfo.getConstraints(buttonA).toString());
      }
    });
    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.setText(1, 0, 'To keep');",
        "    panel.getFlexCellFormatter().setColSpan(0, 0, 2);",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(2);
    assertThat(panel.getRows()).hasSize(2);
    assertEquals("2 2 [1, 2] {(0,0)=(2,1) (0,1)=(1,1) (1,1)=(1,1)}", panel.getStatus().toString());
  }
View Full Code Here

            "    panel.setText(0, 2, 'Text');",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    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());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo buttonA = panel.getChildrenWidgets().get(0);
        assertEquals("0 0 1 1", HTMLTableInfo.getConstraints(buttonA).toString());
        panel.command_CELLS(buttonA, new Rectangle(0, 0, 2, 1));
        assertEquals("0 0 2 1", HTMLTableInfo.getConstraints(buttonA).toString());
      }
    });
    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.setText(0, 1, 'Text');",
        "    panel.getFlexCellFormatter().setColSpan(0, 0, 2);",
        "  }",
        "}");
    assertThat(panel.getColumns()).hasSize(3);
    assertThat(panel.getRows()).hasSize(1);
    assertEquals("3 1 [2] {(0,0)=(2,1) (1,0)=(1,1)}", panel.getStatus().toString());
  }
View Full Code Here

            "    panel.getFlexCellFormatter().setColSpan(0, 0, 2);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    assertThat(panel.getColumns()).hasSize(2);
    assertThat(panel.getRows()).hasSize(2);
    assertEquals("2 2 [1, 2] {(0,0)=(2,1) (0,1)=(1,1) (1,1)=(1,1)}", panel.getStatus().toString());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo buttonA = panel.getChildrenWidgets().get(0);
        assertEquals("0 0 2 1", HTMLTableInfo.getConstraints(buttonA).toString());
        panel.command_CELLS(buttonA, new Rectangle(0, 0, 1, 1));
        assertEquals("0 0 1 1", HTMLTableInfo.getConstraints(buttonA).toString());
      }
    });
    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.setText(1, 0, 'To keep');",
        "  }",
        "}");
    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

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.