"}");
panel.refresh();
TableLayoutInfo layout = (TableLayoutInfo) panel.getLayout();
// initial state
{
IGridInfo gridInfo = layout.getGridInfo();
assertEquals(1, gridInfo.getColumnCount());
assertEquals(1, gridInfo.getRowCount());
assertThat(layout.getColumns()).hasSize(1);
assertThat(layout.getRows()).hasSize(1);
}
// create Button
WidgetInfo newButton = createButton();
layout.command_CREATE(newButton, 1, false, 1, false);
assertEditor(
"public class Test extends LayoutContainer {",
" public Test() {",
" setLayout(new TableLayout(2));",
" {",
" Button button = new Button('0');",
" add(button);",
" }",
" add(new Text());",
" add(new Text());",
" {",
" Button button = new Button();",
" add(button);",
" }",
" }",
"}");
// new state
{
IGridInfo gridInfo = layout.getGridInfo();
assertEquals(2, gridInfo.getColumnCount());
assertEquals(2, gridInfo.getRowCount());
assertThat(layout.getColumns()).hasSize(2);
assertThat(layout.getRows()).hasSize(2);
}
}