" }",
" }",
"}");
frame.refresh();
// initial state
CycleButtonInfo button = frame.getChildren(CycleButtonInfo.class).get(0);
List<CheckItemInfo> items = button.getCheckItems();
assertThat(items).hasSize(2);
// remove all items
CheckItemInfo item_1 = items.get(0);
CheckItemInfo item_2 = items.get(1);
// delete "item_1", so "item_2" should be checked
item_1.delete();
assertThat(button.getCheckItems()).hasSize(1);
assertEditor(
"import com.gwtext.client.widgets.CycleButton;",
"import com.gwtext.client.widgets.menu.CheckItem;",
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" {",
" CycleButton button = new CycleButton();",
" {",
" CheckItem checkItem2 = new CheckItem('check 2', true);",
" button.addItem(checkItem2);",
" }",
" rootPanel.add(button);",
" }",
" }",
"}");
// delete "item_2", default item should be added
item_2.delete();
assertThat(button.getCheckItems()).hasSize(1);
assertEditor(
"import com.gwtext.client.widgets.CycleButton;",
"import com.gwtext.client.widgets.menu.CheckItem;",
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",