" rootPanel.add(bar);",
" }",
"}");
MenuBarInfo bar = getJavaInfoByName("bar");
IMenuInfo barObject = MenuObjectInfoUtils.getMenuInfo(bar);
IMenuPolicy barPolicy = barObject.getPolicy();
// don't accept something other than MenuItem or MenuItemSeparator
assertFalse(barPolicy.validateCreate(new Object()));
// create new MenuItemSeparator
MenuItemSeparatorInfo newSeparator =
createJavaInfo("com.google.gwt.user.client.ui.MenuItemSeparator");
assertTrue(barPolicy.validateCreate(newSeparator));
barPolicy.commandCreate(newSeparator, null);
assertEditor(
"public class Test implements EntryPoint {",
" public void onModuleLoad() {",
" RootPanel rootPanel = RootPanel.get();",
" MenuBar bar = new MenuBar();",