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

Examples of com.google.gdt.eclipse.designer.model.widgets.panels.RootPanelInfo


  ////////////////////////////////////////////////////////////////////////////
  /**
   * Test for {@link AbsolutePanelAlignmentSupport}.
   */
  public void test_alignmentActions_LEFT() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
View Full Code Here


  /**
   * Test for {@link AbsolutePanelAlignmentSupport}.
   */
  public void test_alignmentActions_crossPanel() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
View Full Code Here

   * Test for {@link AbsolutePanelAlignmentSupport}.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.asp?45507
   */
  public void test_alignmentActions_oneWidget_onSimplePanel() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
View Full Code Here

   * is not empty.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?44967
   */
  public void test_parse_setText() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      FlexTable panel = new FlexTable();",
            "      rootPanel.add(panel);",
            "      panel.setText(0, 0, 'Some very very long text');",
            "    }",
            "  }",
            "}");
    frame.refresh();
    FlexTableInfo panel = getJavaInfoByName("panel");
    // if not replaced with "filler", then "panel" has big width
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.width).isGreaterThan(150);
View Full Code Here

   * is not empty.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?44967
   */
  public void test_parse_setHTML() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    {",
            "      FlexTable panel = new FlexTable();",
            "      rootPanel.add(panel);",
            "      panel.setHTML(0, 0, 'Some very very long text');",
            "    }",
            "  }",
            "}");
    frame.refresh();
    FlexTableInfo panel = getJavaInfoByName("panel");
    // if not replaced with "filler", then "panel" has big width
    {
      Rectangle bounds = panel.getBounds();
      assertThat(bounds.width).isGreaterThan(150);
View Full Code Here

        helperType.getCompilationUnit().getUnderlyingResource().delete(true, null);
        waitForAutoBuild();
      }
    }
    // parse
    RootPanelInfo frame =
        parseJavaInfo(
            "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.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)}",
View Full Code Here

  }

  public void test_FlexTableHelper_addFix() throws Exception {
    dontUseSharedGWTState();
    {
      RootPanelInfo frame =
          parseJavaInfo(
              "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.getFlexCellFormatter().setRowSpan(0, 0, 2);",
              "  }",
              "}");
      frame.refresh();
      assertNoErrors(frame);
      FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
      // no FlexTableHelper initially
      assertNull(m_testProject.getJavaProject().findType("test.client.FlexTableHelper"));
      // ensure FlexTableHelper
      {
        panel.ensureFlexTableHelper();
        assertNotNull(m_testProject.getJavaProject().findType("test.client.FlexTableHelper"));
        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.getFlexCellFormatter().setRowSpan(0, 0, 2);",
            "    FlexTableHelper.fixRowSpan(panel);",
            "  }",
            "}");
      }
    }
    //
    RootPanelInfo frame;
    {
      String source = m_lastEditor.getSource();
      tearDown();
      setUp();
      dontUseSharedGWTState();
      frame = (RootPanelInfo) parseSource("test.client", "Test.java", source);
      frame.refresh();
      assertNoErrors(frame);
    }
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    // with fix each row should have 2 visual cells, but row "1" has only 1 TD element
    assertEquals(2, ReflectionUtils.invokeMethod(panel.getObject(), "getCellCount(int)", 0));
    assertEquals(1, 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)}",
View Full Code Here

   */
  public void test_FlexTableHelper_fixReference() throws Exception {
    dontUseSharedGWTState();
    FlexTableInfo.ensureFlexTableHelper(m_testProject.getSourceFolder().getPackageFragment(
        "test.client"));
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    FlexTable panel = new FlexTable();",
            "    rootPanel.add(panel);",
            "    FlexTableHelper.fixRowSpan(panel);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    // add new statement, should be added before fixRowSpan()
    {
      StatementTarget target = JavaInfoUtils.getTarget(panel, null);
      panel.addExpressionStatement(target, "System.out.println()");
    }
View Full Code Here

   */
  public void test_FlexTableHelper_fix2() throws Exception {
    dontUseSharedGWTState();
    FlexTableInfo.ensureFlexTableHelper(m_testProject.getSourceFolder().getPackageFragment(
        "test.client"));
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    FlexTable panel = new FlexTable();",
            "    rootPanel.add(panel);",
            "    FlexTableHelper.fixRowSpan(panel);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    // ask "ensure" again, no change expected
    String expectedSource = m_lastEditor.getSource();
    panel.ensureFlexTableHelper();
    assertEditor(expectedSource, m_lastEditor);
  }
View Full Code Here

  /**
   * Test for {@link HTMLTableInfo#insertColumn(int)}. <br>
   * Append column to empty table.
   */
  public void test_insertColumn_appendToEmpty() throws Exception {
    RootPanelInfo frame =
        parseJavaInfo(
            "public class Test implements EntryPoint {",
            "  public void onModuleLoad() {",
            "    RootPanel rootPanel = RootPanel.get();",
            "    FlexTable panel = new FlexTable();",
            "    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() {
View Full Code Here

TOP

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

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.