cEditor.setActivePage(page.getId());
assertNotNull("Could not load beans page.", page.getMasterPart());
}
});
SWTBotButton newBeanButton = bot.flatButton("New Bean...");
SWTBotButton upButton = bot.flatButton("Up");
SWTBotButton downButton = bot.flatButton("Down");
assertFalse(upButton.isEnabled());
assertFalse(downButton.isEnabled());
UIThreadRunnable.syncExec(new VoidResult() {
public void run() {
TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
TreeItem root = treeViewer.getTree().getItem(0);
TreeItem beanItem = root.getItem(1);
page.setSelection(new StructuredSelection(beanItem.getData()));
}
});
assertTrue(upButton.isEnabled());
assertTrue(downButton.isEnabled());
newBeanButton.click();
SWTBotShell newBeanDialog = bot.shell("Create New Bean");
assertTrue(newBeanDialog.isOpen());
newBeanDialog.close();