本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotTree.getTreeItem方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotTree.getTreeItem方法的具体用法?Java SWTBotTree.getTreeItem怎么用?Java SWTBotTree.getTreeItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swtbot.swt.finder.widgets.SWTBotTree
的用法示例。
在下文中一共展示了SWTBotTree.getTreeItem方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: expandNode
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
/**
* Attempts to expand all nodes along the path specified by the node array parameter.
* The method is copied from SWTBotTree with an additional check if the node is already expanded.
*
* @param bot
* tree bot, must not be {@code null}
* @param nodes
* node path to expand, must not be {@code null} or empty
* @return the last tree item that was expanded, or {@code null} if no item was found
*/
public static SWTBotTreeItem expandNode(final SWTBotTree bot, final String... nodes) {
Assert.isNotNull(bot, ARGUMENT_BOT);
Assert.isNotNull(nodes, ARGUMENT_NODES);
assertArgumentIsNotEmpty(nodes, ARGUMENT_NODES);
new SWTBot().waitUntil(widgetIsEnabled(bot));
SWTBotTreeItem item = bot.getTreeItem(nodes[0]);
if (!item.isExpanded()) {
item.expand();
}
final List<String> asList = new ArrayList<String>(Arrays.asList(nodes));
asList.remove(0);
if (!asList.isEmpty()) {
item = expandNode(item, asList.toArray(new String[asList.size()]));
}
return item;
}
示例2: openPropertiesPage
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public GW4EProjectProperties openPropertiesPage ( ) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(this.projectName);
item.setFocus();
item.select();
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
SWTBotTreeItem treeItem = tree.getTreeItem(projectName);
return treeItem.isSelected();
}
@Override
public String getFailureMessage() {
return "Project " + projectName + " not selected ";
}
};
bot.waitUntil(condition);
bot.menu( "File").menu("Properties").click();
bot.waitUntil(Conditions.shellIsActive("Properties for " + projectName));
SWTBotShell shell = bot.shell("Properties for " + projectName).activate();
shell.bot().tree().select("GW4E");
bot.waitUntil(Conditions.waitForWidget(WidgetMatcherFactory.withId( ProjectPropertyPage.PROJECT_PROPERTY_PAGE_WIDGET_ID, ProjectPropertyPage.PROJECT_PROPERTY_PAGE_WIDGET_SECURITY_LEVEL_FOR_ABSTRACT_CONTEXT)));
return new GW4EProjectProperties(bot,shell);
}
示例3: showConsolePreference
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
private void showConsolePreference(SWTBotShell shell) {
SWTBotTree tree = bot.tree().select("Run/Debug");
SWTBotTreeItem item = tree.getTreeItem("Console");
item.click();
SWTBotCheckBox button = bot.checkBoxWithLabel("Limit console output");
if (button.isChecked()) button.click();
}
示例4: getContextMenuAndGenerateDocu
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
/**
*
* @param tree
* @param orderNumber
* @param actionName
* @return SWTBotMenu
*/
@Deprecated
protected SWTBotMenu getContextMenuAndGenerateDocu(final SWTBotTree tree, final String orderNumber,
final String actionName) {
final SWTBotTreeItem treeItem = tree.getTreeItem(orderNumber);
return getContextMenuAndGenerateDocu(tree, treeItem, actionName);
}
示例5: execute
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
@Test
public void execute() {
SWTBotTree tree = bot.tree();
final SWTBotTreeItem orderTreeItem = tree.getTreeItem(CreateTempOrderRule.ORDER_NUMBER_TEMP);
expandTreeItem(orderTreeItem);
generateInitialViewDocuForOrderOverview();
SWTBotTreeItem firstPositionNode = orderTreeItem.getItems()[0];
SWTBotMenu menu = getContextMenuAndGenerateDocu(tree, firstPositionNode, "Edit Position");
LOGGER.info(menu.toString());
clickMenuEntryAndGenerateDocu(menu, PageName.POSITION_DETAIL);
String articleName = firstPositionNode.getText();
String editorTitle = CreateTempOrderRule.ORDER_NUMBER_TEMP + " - " + articleName + " - " + POSITION_STATE;
LOGGER.info("select Position Editor: " + editorTitle);
SWTBotView partByTitle = wbBot.partByTitle(editorTitle);
Assert.assertNotNull(partByTitle);
LOGGER.info("part: " + partByTitle.getPart().toString());
selectArticleAndGenerateDocu(articleName);
saveAllAndGenerateDocu();
// close order details
partByTitle.close();
generateDocu("check if part was closed", PageName.POSITION_DETAIL);
LOGGER.info(getClass().getSimpleName() + " successful!");
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:33,代码来源:ChangeArticleUpdatesTheOrderOverviewTest.java
示例6: isSelected
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
public boolean isSelected (SWTBotGefEditPart part) {
GraphElement element = (GraphElement) part.part().getModel();
SWTBotTree tree = botView.bot().treeWithId(GW4EOutlinePage.GW_WIDGET_ID,GW4EOutlinePage.GW_OUTLINE_ELEMENTS_TREE);
SWTBotTreeItem item = tree.getTreeItem(element.getName());
return item.isSelected();
}
示例7: openContextMenuForOrder
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
protected void openContextMenuForOrder(final SWTBotTree tree, final String orderNumber) {
final SWTBotTreeItem treeItem = tree.getTreeItem(orderNumber);
openContextMenuForTreeItem(tree, treeItem);
}
示例8: execute
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTree; //导入方法依赖的package包/类
@Test
public void execute() {
generateInitialViewDocuForOrderOverview();
SWTBotTree tree = bot.tree();
final SWTBotTreeItem treeItem = tree.getTreeItem("Order 2");
expandTreeItemAndGenerateDocu(treeItem);
Assert.assertTrue(treeItem.isExpanded());
collapseTreeItemAndGenerateDocu(treeItem);
Assert.assertFalse(treeItem.isExpanded());
LOGGER.info(getClass().getSimpleName() + " successful!");
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:19,代码来源:ShowAllOrderItemsInOrderOverviewTest.java