////////////////////////////////////////////////////////////////////////////
/**
* Test for {@link SimplePanelInfo#command_CREATE(WidgetInfo)}.
*/
public void test_CREATE() throws Exception {
SimplePanelInfo panel =
parseJavaInfo(
"// filler filler filler filler filler",
"public class Test extends SimplePanel {",
" public Test() {",
" }",
"}");
refresh();
SimpleContainer simpleContainer = getSimpleContainer(panel);
// no child Widget initially
assertTrue(simpleContainer.isEmpty());
// do CREATE
WidgetInfo newButton = createButton();
simpleContainer.command_CREATE(newButton);
assertEditor(
"// filler filler filler filler filler",
"public class Test extends SimplePanel {",
" public Test() {",
" {",
" Button button = new Button();",
" setWidget(button);",
" button.setSize('100%', '100%');",
" }",
" }",
"}");
assertSame(newButton, panel.getWidget());
assertFalse(simpleContainer.isEmpty());
}