当前位置: 首页>>代码示例>>Java>>正文


Java SWTBotTreeItem.getItems方法代码示例

本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getItems方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotTreeItem.getItems方法的具体用法?Java SWTBotTreeItem.getItems怎么用?Java SWTBotTreeItem.getItems使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem的用法示例。


在下文中一共展示了SWTBotTreeItem.getItems方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: test

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public boolean test() throws Exception {
	try {
		
		SWTBotTreeItem item = this.problemView.expandErrorItem ();
		SWTBotTreeItem[] child = item.getItems();
		for (int i = 0; i < child.length; i++) {
			if (child[i].isSelected() && child[i].row().get(0).equalsIgnoreCase(checkedItem.row().get(0))) {
				return true;
			}
		}
		retry ();
		return false;
	} catch (WidgetNotFoundException e) {
		retry ();
		return false;
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:18,代码来源:IsItemSelectedInErrors.java

示例2: selectTreeItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * Select a tree item.
 *
 * @param treeItem
 *          the tree node
 * @param name
 *          the name of the item to look for
 * @return true, if item was found and selected
 */
private static boolean selectTreeItem(final SWTBotTreeItem treeItem, final String name) {
  if (name.equals(treeItem.getText())) {
    treeItem.select();
    return true;
  }
  if (!treeItem.isExpanded()) {
    treeItem.expand();
  }
  for (SWTBotTreeItem item : treeItem.getItems()) {
    if (selectTreeItem(item, name)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:25,代码来源:SwtBotWizardUtil.java

示例3: openView

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * Open view.
 *
 * @param bot
 *          to work with, must not be {@code null}
 * @param category
 *          the category, must not be {@code null}
 * @param view
 *          the name of the view, must not be {@code null}
 */
public static void openView(final SWTWorkbenchBot bot, final String category, final String view) {
  Assert.isNotNull(bot, ARGUMENT_BOT);
  Assert.isNotNull(category, "category");
  Assert.isNotNull(view, ARGUMENT_VIEW);
  bot.menu("Window").menu("Show View").menu("Other...").click();
  bot.shell("Show View").activate();
  final SWTBotTree tree = bot.tree();

  for (SWTBotTreeItem item : tree.getAllItems()) {
    if (category.equals(item.getText())) {
      CoreSwtbotTools.waitForItem(bot, item);
      final SWTBotTreeItem[] node = item.getItems();

      for (SWTBotTreeItem swtBotTreeItem : node) {
        if (view.equals(swtBotTreeItem.getText())) {
          swtBotTreeItem.select();
        }
      }
    }
  }
  assertTrue("View or Category found", bot.button().isEnabled());
  bot.button("OK").click();
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:34,代码来源:CoreSwtbotTools.java

示例4: deleteConnection

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * 完整步骤:根据从 Excel 中读取的数据删除已保存的连接信息
 * @param from
 *            功能入口,请使用 TSUIConstants 类的枚举;
 */
public void deleteConnection(Entry from) {
	mode = MemoryDatabaseManagementDialog.MANAGEMENT;
	openDBMgmgDialog(from);
	getDataConnect(mode);
	assertTrue("未在已保存的连接信息中找到该连接:" + connectionName, isConnectionSaved());
	
	SWTBotTreeItem curDb = selectDBType();
	int countBefore = curDb.getItems().length;
	curDb.expandNode(connectionName).select();
	dialog.btnRemoveConn().click();
	
	int countRemove = curDb.getItems().length;
	assertTrue("仍可在已保存的连接信息中找到该连接:" + connectionName, countBefore == countRemove+1 );
	dialog.btnClose().click();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:21,代码来源:MemoryDBManagement.java

示例5: countErrorWithText

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public int countErrorWithText(String text) {
	SWTBotTreeItem item = expandErrorItem();
	int found=0;
	SWTBotTreeItem[] child = item.getItems();
	for (int i = 0; i < child.length; i++) {
		if (child[i].row().get(0).trim().startsWith(text.trim())) {
			found++;
		}
	}
	return found;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:ProblemView.java

示例6: isExpanded

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private boolean isExpanded (SWTBotTreeItem  parent , String nodename) {
	SWTBotTreeItem[] items = parent.getItems();
	for (int i = 0; i < items.length; i++) {
		if (items[i].getText().equalsIgnoreCase(nodename)) {
			return items[i].isExpanded();
		}
	}
	return false;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:TreeNodeFoundCondition.java

示例7: getFailureMessage

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public String getFailureMessage() {
	String newline = System.getProperty("line.separator");
	SWTBotTreeItem item = this.problemView.expandErrorItem ();
	SWTBotTreeItem[] child = item.getItems();
	StringBuffer sb = new StringBuffer (newline);
	for (int i = 0; i < child.length; i++) {
		String row = child[i].isSelected() + " " + child[i].row().get(0) + newline;
		sb.append(row);
			 
	}
	return "item '" + checkedItem + "' is not clicked in the problem view in  " + sb.toString();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:IsItemSelectedInErrors.java

示例8: waitForItem

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
/**
 * Expansion of items in a SWTBotTree. Will try collapse and expand if there are no child nodes.
 *
 * @param bot
 *          to work with, must not be {@code null}
 * @param item
 *          to wait for, must not be {@code null}
 * @return {@code true} if expanded, {@code false} otherwise
 */
public static boolean waitForItem(final SWTWorkbenchBot bot, final SWTBotTreeItem item) {
  Assert.isNotNull(bot, ARGUMENT_BOT);
  Assert.isNotNull(item, ARGUMENT_ITEM);
  item.select();
  safeBlockingExpand(bot, item);
  if (item.getItems().length == 0) {
    safeBlockingCollapse(bot, item);
    safeBlockingExpand(bot, item);
  }
  return item.getItems().length > 0;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:21,代码来源:CoreSwtbotTools.java

示例9: execute

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的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

示例10: deleteLaunchConfigs

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
public static void deleteLaunchConfigs(final SWTWorkbenchBot bot) {
  SwtBotUtils.print("\tDeleting launch configs");

  SwtBotLaunchManagerActions.terminateAllLaunchConfigs(bot);

  SwtBotMenuActions.openDebugConfiguration(bot);

  // TODO change to Messages.get
  SWTBotTreeItem subTree = bot.tree(0).getTreeItem("GWT Development Mode (DevMode)");
  subTree.expand();

  SWTBotTreeItem[] items = subTree.getItems();
  if (items != null && items.length > 0) {
    for (int i=0; i < items.length; i++) {
      SwtBotUtils.print("\t\tDeleting launcher i=" + i);
      items[i].contextMenu("Delete").click();

      SwtBotUtils.performAndWaitForWindowChange(bot, new Runnable() {
        @Override
        public void run() {
          bot.button("Yes").click();
        }
      });

      bot.sleep(500);
    }
  }

  bot.button("Close").click();

  SwtBotUtils.print("\tDeleted launch configs");
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:33,代码来源:SwtBotProjectActions.java

示例11: getFirstTreeItemForOrder

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private SWTBotTreeItem getFirstTreeItemForOrder(final String orderNumber) {
	SWTBotTreeItem orderTreeItem = tree.getTreeItem(orderNumber);
	return orderTreeItem.getItems()[0];
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:5,代码来源:OrderOverviewPageObject.java

示例12: getLastTreeItemForOrder

import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; //导入方法依赖的package包/类
private SWTBotTreeItem getLastTreeItemForOrder(final String orderNumber) {
	SWTBotTreeItem orderTreeItem = tree.getTreeItem(orderNumber);
	int length = orderTreeItem.getItems().length;
	return orderTreeItem.getItems()[length - 1];
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:6,代码来源:OrderOverviewPageObject.java


注:本文中的org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem.getItems方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。