" add(button);",
" }",
" }",
"}");
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(
"import com.google.gwt.user.client.ui.Button;",
"public class Test extends Panel {",
" public Test() {",
" setLayout(new TableLayout(2));",
" {",
" Button button = new Button('0');",
" add(button);",
" }",
" add(new Label());",
" add(new Label());",
" {",
" 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);
}
}