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

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


    assertHierarchy(
        "{RootPanel.get()} {local-unique: rootPanel} {/RootPanel.get()/ /rootPanel.add(panel)/}",
        "  {new: test.client.MyPanel} {local-unique: panel} {/new MyPanel()/ /rootPanel.add(panel)/}");
    frame.refresh();
    //
    HTMLTableInfo panel = getJavaInfoByName("panel");
    assertTrue(panel.isPlaceholder());
  }
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(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 {
        panel.deleteColumn(1);
      }
    });
    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('A'));",
        "  }",
        "}");
    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(0, 1, '100px');",
            "  }",
            "}");
    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.deleteColumn(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(0, 'A');",
            "  }",
            "}");
    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 {
        panel.deleteColumn(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, 1, new Button('C'));",
        "    panel.getCellFormatter().setWidth(0, 0, '10px');",
        "    panel.getCellFormatter().setWidth(0, 1, '30px');",
        "    panel.getFlexCellFormatter().setColSpan(0, 0, 1);",
        "    panel.getFlexCellFormatter().setColSpan(0, 1, 1);",
        "    panel.getColumnFormatter().setWidth(0, '100px');",
        "    panel.getColumnFormatter().setWidth(1, '300px');",
        "    panel.getRowFormatter().setStyleName(0, 'A');",
        "  }",
        "}");
    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());
  }
View Full Code Here

            "    panel.getFlexCellFormatter().setColSpan(1, 1, 3);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    final HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    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());
    // do operation
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        panel.deleteColumn(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().setColSpan(1, 1, 2);",
        "  }",
        "}");
    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());
  }
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(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.clearColumn(0);
      }
    });
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
        "    FlexTable panel = new FlexTable();",
        "    rootPanel.add(panel);",
        "    panel.setWidget(0, 1, new Button('B'));",
        "  }",
        "}");
    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());
  }
View Full Code Here

            "    panel.getCellFormatter().setWidth(0, 1, '100px');",
            "  }",
            "}");
    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.clearColumn(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(0, 1, '100px');",
            "  }",
            "}");
    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.clearColumn(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

            "    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.getFlexCellFormatter().setRowSpan(0, 0, 2);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    // no fix, so each row has 2 cells, however for row "0" this means 3 (!) visual cells
    assertEquals(2, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 0));
    assertEquals(2, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 1));
    assertEquals(
        "2 2 [2, 2] {(0,0)=(1,2) (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.