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


Java SWTBot.waitUntil方法代码示例

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


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

示例1: waitUntilTreeHasItemImpl

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
private static boolean waitUntilTreeHasItemImpl(SWTBot bot, final TreeItem tree,
    final String nodeText) {
  try {
    bot.waitUntil(new DefaultCondition() {
      @Override
      public String getFailureMessage() {
        return "Could not find node with text " + nodeText;
      }

      @Override
      public boolean test() throws Exception {
        return getTreeItem(tree, nodeText) != null;
      }
    });
  } catch (TimeoutException ex) {
    return false;
  }

  return true;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:21,代码来源:SwtBotTreeUtilities.java

示例2: waitUntilTreeHasTextImpl

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
private static boolean waitUntilTreeHasTextImpl(SWTBot bot, final TreeItem tree) {
  try {
    bot.waitUntil(new DefaultCondition() {
      @Override
      public String getFailureMessage() {
        return "Not all of the nodes in the tree have text.";
      }

      @Override
      public boolean test() throws Exception {
        return treeItemHasText(tree);
      }
    });
  } catch (TimeoutException ex) {
    return false;
  }

  return true;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:20,代码来源:SwtBotTreeUtilities.java

示例3: waitUntilTreeItemHasItem

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Blocks the caller until the tree item has the given item text.
 * 
 * @param tree the tree item to search
 * @param nodeText the item text to look for
 * @throws org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException if the item could not
 *         be found within the timeout period
 */
private static void waitUntilTreeItemHasItem(SWTBot bot, final SWTBotTreeItem tree,
    final String nodeText) {

  // Attempt #1
  if (!waitUntilTreeHasItemImpl(bot, tree.widget, nodeText)) {
    // Attempt #2: Something went wrong, try to cautiously reopen it.
    bot.sleep(1000);

    // There isn't a method to collapse, so double-click instead
    tree.doubleClick();
    bot.waitUntil(new TreeCollapsedCondition(tree.widget));

    bot.sleep(1000);

    tree.expand();
    bot.waitUntil(new TreeExpandedCondition(tree.widget));

    if (!waitUntilTreeHasItemImpl(bot, tree.widget, nodeText)) {
      printTree(tree.widget);
      throw new TimeoutException(
          String.format("Timed out waiting for %s, giving up...", nodeText));
    }
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:33,代码来源:SwtBotTreeUtilities.java

示例4: waitUntilTreeHasItemImpl

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
private static boolean waitUntilTreeHasItemImpl(SWTBot bot, final TreeItem tree,
    final String nodeText) {
  try {
    bot.waitUntil(new DefaultCondition() {
      @Override
      public String getFailureMessage() {
        return "Could not find node with text " + nodeText;
      }

      @Override
      public boolean test() throws Exception {
        return getTreeItem(tree, nodeText) != null;
      }
    });
  } catch (TimeoutException e) {
    return false;
  }

  return true;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:21,代码来源:SwtBotTreeActions.java

示例5: waitUntilTreeHasTextImpl

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
private static boolean waitUntilTreeHasTextImpl(SWTBot bot, final TreeItem tree) {
  try {
    bot.waitUntil(new DefaultCondition() {
      @Override
      public String getFailureMessage() {
        return "Not all of the nodes in the tree have text.";
      }

      @Override
      public boolean test() throws Exception {
        return doesTreeItemHaveText(tree);
      }
    });
  } catch (TimeoutException e) {
    return false;
  }

  return true;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:20,代码来源:SwtBotTreeActions.java

示例6: waitUntilTreeItemHasItem

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Blocks the caller until the tree item has the given item text.
 *
 * @param tree the tree item to search
 * @param nodeText the item text to look for
 * @throws org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException if the item could not
 *         be found within the timeout period
 */
private static void waitUntilTreeItemHasItem(SWTBot bot, final SWTBotTreeItem tree,
    final String nodeText) {

  // Attempt #1
  if (!waitUntilTreeHasItemImpl(bot, tree.widget, nodeText)) {
    // Attempt #2: Something went wrong, try to cautiously reopen it.
    bot.sleep(1000);

    // There isn't a method to collapse, so double-click instead
    tree.doubleClick();
    bot.waitUntil(new TreeCollapsedCondition(tree.widget));

    bot.sleep(1000);

    tree.expand();
    bot.waitUntil(new TreeExpandedCondition(tree.widget));

    if (!waitUntilTreeHasItemImpl(bot, tree.widget, nodeText)) {
      printTree(tree.widget);
      throw new TimeoutException(
          String.format("Timed out waiting for %s, giving up...", nodeText));
    }
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:33,代码来源:SwtBotTreeActions.java

示例7: waitUntilTreeHasText

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Blocks the caller until all of the direct children of the tree have text. The assumption is
 * that the tree does not have any "empty" children.
 *
 * TODO: Refactor some of this logic; it follows the same general pattern as
 * {@link #waitUntilTreeItemHasItem(SWTBot, SWTBotTreeItem, String)}.
 *
 * @param tree the tree to search
 * @throws TimeoutException if all of the direct children of the tree do not have text within the
 *         timeout period
 */
public static void waitUntilTreeHasText(SWTBot bot, final SWTBotTreeItem tree)
    throws TimeoutException {
  // Attempt #1
  if (!waitUntilTreeHasTextImpl(bot, tree.widget)) {
    // Attempt #2: Something went wrong, try to cautiously reopen it.
    bot.sleep(1000);

    // There isn't a method to collapse, so double-click instead
    tree.doubleClick();
    bot.waitUntil(new TreeCollapsedCondition(tree.widget));

    bot.sleep(1000);

    tree.expand();
    bot.waitUntil(new TreeExpandedCondition(tree.widget));

    if (!waitUntilTreeHasTextImpl(bot, tree.widget)) {
      printTree(tree.widget);
      throw new TimeoutException(
          "Timed out waiting for text of the tree's children, giving up...");
    }
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:35,代码来源:SwtBotTreeActions.java

示例8: GraphModelProperties

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
public GraphModelProperties(SWTBot bot, String project, String folder,String pkg,  String filename) {
	super();
	this.bot = bot;
	this.project = project;
	this.folder = folder;
	this.pkg = pkg;
	this.filename = filename;
	bot.tree().setFocus();
	
	bot.tree().select("GW4E");
	bot.waitUntil(Conditions.waitForWidget(WidgetMatcherFactory.withId(GraphModelPropertyPage.GW4E_LABEL_ID, GraphModelPropertyPage.GW4E_LABEL_ID)));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:GraphModelProperties.java

示例9: waitUntilTreeHasText

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Blocks the caller until all of the direct children of the tree have text. The assumption is
 * that the tree does not have any "empty" children.
 * 
 * @param tree the tree to search
 * @throws TimeoutException if any of the direct children of the tree do not have text within the
 *         timeout period
 */
public static void waitUntilTreeHasText(SWTBot bot, final SWTBotTreeItem tree)
    throws TimeoutException {
  // TODO: Refactor some of this logic; it follows the same general pattern as
  // {@link #waitUntilTreeItemHasItem(SWTBot, SWTBotTreeItem, String)}.

  // Attempt #1
  if (!waitUntilTreeHasTextImpl(bot, tree.widget)) {
    // Attempt #2: Something went wrong, try to cautiously reopen it.
    bot.sleep(1000);

    // There isn't a method to collapse, so double-click instead
    tree.doubleClick();
    bot.waitUntil(new TreeCollapsedCondition(tree.widget));

    bot.sleep(1000);

    tree.expand();
    bot.waitUntil(new TreeExpandedCondition(tree.widget));

    if (!waitUntilTreeHasTextImpl(bot, tree.widget)) {
      printTree(tree.widget);
      throw new TimeoutException(
          "Timed out waiting for text of the tree's children, giving up...");
    }
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:35,代码来源:SwtBotTreeUtilities.java

示例10: waitUntilShellIsNotActive

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Blocks the caller until the given shell is no longer active.
 */
public static void waitUntilShellIsNotActive(SWTBot bot, final SWTBotShell shell) {
  bot.waitUntil(new DefaultCondition() {
    @Override
    public String getFailureMessage() {
      return "Shell " + shell.getText() + " did not close"; //$NON-NLS-1$
    }

    @Override
    public boolean test() throws Exception {
      return !shell.isActive();
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:SwtBotTestingUtilities.java

示例11: waitUntilShellIsClosed

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Blocks the caller until the given shell is closed.
 */
public static void waitUntilShellIsClosed(SWTBot bot, final SWTBotShell shell) {
  bot.waitUntil(new DefaultCondition() {
    @Override
    public String getFailureMessage() {
      return "Shell " + shell.getText() + " did not close"; //$NON-NLS-1$
    }

    @Override
    public boolean test() throws Exception {
      return !shell.isOpen();
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:SwtBotTestingUtilities.java

示例12: waitUntilStyledTextContains

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Wait until the given text widget contains the provided string
 */
public static void waitUntilStyledTextContains(SWTBot bot, final String text,
    final SWTBotStyledText widget) {
  bot.waitUntil(new DefaultCondition() {
    @Override
    public boolean test() throws Exception {
      return widget.getText().contains(text);
    }

    @Override
    public String getFailureMessage() {
      return "Text not found!";
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:18,代码来源:SwtBotTestingUtilities.java

示例13: waitUntilFacetedProjectExists

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
/**
 * Spin until the given project actually exists and is facetd.
 *
 * @return the project
 */
private static IProject waitUntilFacetedProjectExists(SWTBot bot, final IProject project) {
  bot.waitUntil(new DefaultCondition() {
    @Override
    public String getFailureMessage() {
      return "Project does not exist! " + project;
    }

    @Override
    public boolean test() throws Exception {
      return project.exists() && FacetedProjectFramework.isFacetedProject(project);
    }
  });
  return project;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:20,代码来源:SwtBotAppEngineActions.java

示例14: StaticGeneratorWizard

import org.eclipse.swtbot.swt.finder.SWTBot; //导入方法依赖的package包/类
public StaticGeneratorWizard(SWTBot bot) {
	super();
	this.bot = bot;
	bot.waitUntil(new ShellActiveCondition(SHELL_TITLE), 5 * 1000);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:6,代码来源:StaticGeneratorWizard.java


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