frame.refresh();
// initial state
FormPanelInfo form = frame.getChildren(FormPanelInfo.class).get(0);
List<FieldInfo> fields = form.getFields();
assertThat(fields).hasSize(2);
FieldInfo field_1 = fields.get(0);
FieldInfo field_2 = fields.get(1);
// delete "field_1", "field_2" still alive
{
field_1.delete();
assertEditor(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",
" FormPanel form = new FormPanel();",
" {",
" TextField field_2 = new TextField();",
" form.add(field_2);",
" }",
" rootPanel.add(form);",
" }",
" }",
"}");
}
// delete "field_2", some default Field should be added
field_2.delete();
assertEditor(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",