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(2);
    assertThat(panel.getRows()).hasSize(1);
    assertEquals("2 1 [2] {(0,0)=(1,1) (1,0)=(1,1)}", panel.getStatus().toString());
    // do MOVE
    ExecutionUtils.run(frame, new RunnableEx() {
      public void run() throws Exception {
        WidgetInfo button_2 = frame.getChildrenWidgets().get(1);
        panel.command_MOVE(button_2, 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_2 = new Button();",
        "      panel.setWidget(0, 0, button_2);",
        "    }",
        "    {",
        "      Button button_1 = new Button();",
        "      panel.setWidget(0, 1, button_1);",
        "    }",
        "  }",
        "}");
    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.setWidget(1, 1, new Button('B'));",
            "  }",
            "}");
    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 buttonB = panel.getChildrenWidgets().get(1);
        buttonB.delete();
      }
    });
    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.getFlexCellFormatter().setRowSpan(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 [2, 2] {(0,0)=(1,2) (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);
        buttonA.delete();
      }
    });
    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'));",
        "    panel.setWidget(1, 1, new Button('C'));",
        "  }",
        "}");
    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

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

   * in cell 0x0.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.asp?47257
   */
  public void test_tree_noCREATE() throws Exception {
    HTMLTableInfo panel =
        openJavaInfo(
            "// filler filler filler filler filler",
            "public class Test extends Grid {",
            "  public Test() {",
            "  }",
View Full Code Here

        "      rootPanel.add(panel);",
        "    }",
        "  }",
        "}");
    // select, no exceptions
    HTMLTableInfo panel = getJavaInfoByName("panel");
    canvas.select(panel);
  }
View Full Code Here

            "    rootPanel.add(panel);",
            "    panel.setWidget(0, 0, new Button());",
            "  }",
            "}");
    frame.refresh();
    HTMLTableInfo panel = (HTMLTableInfo) frame.getChildrenWidgets().get(0);
    WidgetInfo button = panel.getChildrenWidgets().get(0);
    // prepare accessor
    ExpressionAccessor accessor = new CellFormatterExpressionAccessor("setVisible", "boolean");
    // initially no Expression
    assertNull(accessor.getExpression(button));
    // try to remove Expression, no changes
View Full Code Here

  /**
   * Sets the alignment for {@link ColumnInfo}.
   */
  private void setAlignment(final ColumnInfo.Alignment alignment) {
    final HTMLTableInfo panel = getPanel();
    ExecutionUtils.run(panel, new RunnableEx() {
      public void run() throws Exception {
        getDimension().setAlignment(alignment);
      }
    });
View Full Code Here

  /**
   * Sets the alignment for {@link RowInfo}.
   */
  private void setAlignment(final RowInfo.Alignment alignment) {
    final HTMLTableInfo panel = getPanel();
    ExecutionUtils.run(panel, new RunnableEx() {
      public void run() throws Exception {
        getDimension().setAlignment(alignment);
      }
    });
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.