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

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


   * returned.
   * <p>
   * http://fogbugz.instantiations.com/fogbugz/default.php?44300
   */
  public void test_parse_this() throws Exception {
    FlexTableInfo panel =
        parseJavaInfo(
            "public class Test extends FlexTable {",
            "  public void onModuleLoad() {",
            "    setWidget(0, 0, new Button('A'));",
            "  }",
            "}");
    panel.refresh();
    assertNoErrors(panel);
  }
View Full Code Here


            "      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);
    }
    // column is not empty
    {
      List<ColumnInfo> columns = panel.getColumns();
      assertThat(columns).hasSize(1);
      ColumnInfo column = columns.get(0);
      assertFalse(column.isEmpty());
    }
    // row is not empty
    {
      List<RowInfo> rows = panel.getRows();
      assertThat(rows).hasSize(1);
      RowInfo row = rows.get(0);
      assertFalse(row.isEmpty());
    }
  }
View Full Code Here

            "      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);
    }
    // column is not empty
    {
      List<ColumnInfo> columns = panel.getColumns();
      assertThat(columns).hasSize(1);
      ColumnInfo column = columns.get(0);
      assertFalse(column.isEmpty());
    }
    // row is not empty
    {
      List<RowInfo> rows = panel.getRows();
      assertThat(rows).hasSize(1);
      RowInfo row = rows.get(0);
      assertFalse(row.isEmpty());
    }
  }
View Full Code Here

              "    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)}",
        panel.getStatus().toString());
  }
View Full Code Here

            "    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()");
    }
    assertEditor(
        "public class Test implements EntryPoint {",
        "  public void onModuleLoad() {",
        "    RootPanel rootPanel = RootPanel.get();",
View Full Code Here

            "    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

            "  }",
            "}");
    frame.refresh();
    //
    {
      FlexTableInfo panel = getJavaInfoByName("panel");
      doCopyPaste(panel, new PasteProcedure<WidgetInfo>() {
        public void run(WidgetInfo copy) throws Exception {
          frame.command_CREATE2(copy, null);
        }
      });
View Full Code Here

            "      }",
            "    }",
            "  }",
            "}");
    GridInfo grid = (GridInfo) composite.getWidget();
    FlexTableInfo flexTable = (FlexTableInfo) grid.getChildrenWidgets().get(0);
    GridInfo grid_1 = (GridInfo) flexTable.getChildrenWidgets().get(0);
    WidgetInfo label = grid_1.getChildrenWidgets().get(0);
    // select "label"
    canvas.select(label);
    // use "Delete" action
    getDeleteAction().run();
View Full Code Here

            "    panel.getFlexCellFormatter().setColSpan(1, 1, 2);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getRowIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(RS, RA), intervals[0]);
View Full Code Here

            "    panel.getFlexCellFormatter().setColSpan(0, 1, 2);",
            "  }",
            "}");
    frame.refresh();
    assertNoErrors(frame);
    FlexTableInfo panel = (FlexTableInfo) frame.getChildrenWidgets().get(0);
    IGridInfo gridInfo = panel.getGridInfo();
    // check intervals
    {
      Interval[] intervals = gridInfo.getColumnIntervals();
      assertEquals(3, intervals.length);
      assertEquals(new Interval(CS, CA), intervals[0]);
View Full Code Here

TOP

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

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.