" 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());
}