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


Java SWTWorkbenchBot.widget方法代码示例

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


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

示例1: doesProjectExist

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Returns true if the specified project can be found in the 'Package Explorer' or 'Project View',
 * otherwise returns false. Throws a WidgetNotFoundException exception if the 'Package Explorer'
 * or 'Project Explorer' view cannot be found.
 *
 * @param bot The SWTWorkbenchBot.
 * @param projectName The name of the project to be found.
 * @return if the project exists
 */
public static boolean doesProjectExist(final SWTWorkbenchBot bot, String projectName) {
  SWTBotView explorer = getPackageExplorer(bot);
  if (explorer == null) {
    throw new WidgetNotFoundException(
        "Could not find the 'Package Explorer' or 'Project Explorer' view.");
  }

  // Select the root of the project tree in the explorer view
  Widget explorerWidget = explorer.getWidget();
  Tree explorerTree = bot.widget(widgetOfType(Tree.class), explorerWidget);
  SWTBotTreeItem[] allItems = new SWTBotTree(explorerTree).getAllItems();
  for (int i = 0; i < allItems.length; i++) {
    if (allItems[i].getText().equals(projectName)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:28,代码来源:SwtBotProjectActions.java

示例2: selectProject

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Returns the specified project. Throws a WidgetNotFoundException if the 'Package Explorer' or
 * 'Project Explorer' view cannot be found or if the specified project cannot be found.
 *
 * @param bot The SWTWorkbenchBot.
 * @param projectName The name of the project to select.
 * @return the tree
 */
public static SWTBotTreeItem selectProject(final SWTWorkbenchBot bot, String projectName) {
  /*
   * Choose either the Package Explorer View or the Project Explorer view. Eclipse 3.3 and 3.4
   * start with the Java Perspective, which has the Package Explorer View open by default, whereas
   * Eclipse 3.5 starts with the Resource Perspective, which has the Project Explorer View open.
   */
  SWTBotView explorer = getPackageExplorer(bot);
  for (SWTBotView view : bot.views()) {
    if (view.getTitle().equals("Package Explorer")
        || view.getTitle().equals("Project Explorer")) {
      explorer = view;
      break;
    }
  }

  if (explorer == null) {
    throw new WidgetNotFoundException(
        "Could not find the 'Package Explorer' or 'Project Explorer' view.");
  }

  // Select the root of the project tree in the explorer view
  Widget explorerWidget = explorer.getWidget();
  Tree explorerTree = bot.widget(widgetOfType(Tree.class), explorerWidget);
  return new SWTBotTree(explorerTree).getTreeItem(projectName).select();
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:34,代码来源:SwtBotProjectActions.java

示例3: openWizard

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * @param matcherImageHyperLink
 * @param bot
 * @return
 */
public static boolean openWizard(Matcher matcherImageHyperLink,
		SWTWorkbenchBot bot) {
	@SuppressWarnings("unchecked")
	ImageHyperlink link = (ImageHyperlink) bot
			.widget(matcherImageHyperLink);
	link.getClass();

	SWTBotImageHyperlink swtbotImageHyperLink = new SWTBotImageHyperlink(
			link);
	swtbotImageHyperLink.click();

	if (swtbotImageHyperLink.isEnabled()) {
		return true;

	}
	return false;
}
 
开发者ID:Tharshayene,项目名称:DevStudioUITestAutomation,代码行数:23,代码来源:DashBoardCreation.java

示例4: projectFound

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Returns true if the specified project is found in the 'Package Explorer' or 'Project View',
 * otherwise returns false. Throws a WidgetNotFoundException exception if the 'Package Explorer'
 * or 'Project Explorer' view cannot be found.
 *
 * @param projectName the name of the project to be found
 * @return true if the project is found, and false if not found
 */
public static boolean projectFound(final SWTWorkbenchBot bot, String projectName) {
  SWTBotView explorer = getExplorer(bot);

  // Select the root of the project tree in the explorer view
  Widget explorerWidget = explorer.getWidget();
  Tree explorerTree = bot.widget(widgetOfType(Tree.class), explorerWidget);
  for (SWTBotTreeItem item : new SWTBotTree(explorerTree).getAllItems()) {
    if (item.getText().equals(projectName)) {
      return true;
    }
  }
  return false;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:22,代码来源:SwtBotProjectActions.java

示例5: selectProject

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Returns the specified project.
 *
 * @param projectName the name of the project to select
 * @return the selected tree item
 * @throws WidgetNotFoundException if the 'Package Explorer' or 'Project Explorer' view cannot be
 *         found or if the specified project cannot be found.
 */
public static SWTBotTreeItem selectProject(final SWTWorkbenchBot bot, String projectName) {
  SWTBotView explorer = getExplorer(bot);

  // Select the root of the project tree in the explorer view
  Widget explorerWidget = explorer.getWidget();
  Tree explorerTree = bot.widget(widgetOfType(Tree.class), explorerWidget);
  return new SWTBotTree(explorerTree).getTreeItem(projectName).select();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:SwtBotProjectActions.java

示例6: getProjectRootTree

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Returns the project root tree in Package Explorer.
 */
public static SWTBotTree getProjectRootTree(SWTWorkbenchBot bot) {
  SWTBotView explorer = getPackageExplorer(bot);

  if (explorer == null) {
    throw new WidgetNotFoundException("Cannot find Package Explorer or Project Explorer");
  }

  Tree tree = bot.widget(widgetOfType(Tree.class), explorer.getWidget());
  return new SWTBotTree(tree);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:14,代码来源:SwtBotProjectActions.java

示例7: getProjectRootTree

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot; //导入方法依赖的package包/类
/**
 * Returns the project root tree in Package Explorer.
 */
public static SWTBotTree getProjectRootTree(SWTWorkbenchBot bot) {
  SWTBotView explorer = getExplorer(bot);
  Tree tree = bot.widget(widgetOfType(Tree.class), explorer.getWidget());
  return new SWTBotTree(tree);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:9,代码来源:SwtBotProjectActions.java


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