" RootPanel rootPanel = RootPanel.get();",
" }",
"}");
frame.refresh();
// create Editor
EditorInfo editor = (EditorInfo) createWidget("com.gwtext.client.widgets.Editor");
// add Editor on root panel
frame.command_CREATE2(editor, null);
assertEditor(
"import com.gwtext.client.widgets.Editor;",
"import com.gwtext.client.widgets.form.TextField;",
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",
" Editor editor = new Editor();",
" {",
" TextField textField = new TextField('New text field', 'text_field', 150);",
" editor.setField(textField);",
" }",
" rootPanel.add(editor);",
" }",
" }",
"}");
// Editor already contains one Field (TextField by default)
List<FieldInfo> children = editor.getChildren(FieldInfo.class);
assertThat(children).hasSize(1);
assertThat(children.get(0).getDescription().getComponentClass().getCanonicalName()).isEqualTo(
"com.gwtext.client.widgets.form.TextField");
}