Java 类org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory 实例源码

项目:gw4e.project    文件:ShellActiveCondition.java   
@Override
public boolean test() throws Exception {
    Matcher<Shell> matcher = WidgetMatcherFactory.withText(title);
    bot.waitUntil(Conditions.waitForShell(matcher));
    SWTBotShell shell = bot.shell(title);
    return shell!=null;
}
项目:gw4e.project    文件:GW4EPreferencePage.java   
private SWTBotShell getPreferenceDialog() {
    Matcher<Shell> matcher = WidgetMatcherFactory.withText("Preferences");
    bot.waitUntil(Conditions.waitForShell(matcher));
    SWTBotShell shell = bot.shell("Preferences");
    shell.activate();
    return shell;
}
项目:gw4e.project    文件:ConsolePreferencePage.java   
private SWTBotShell getPreferenceDialog() {
    Matcher<Shell> matcher = WidgetMatcherFactory.withText("Preferences");
    bot.waitUntil(Conditions.waitForShell(matcher));
    SWTBotShell shell = bot.shell("Preferences");
    shell.activate();
    return shell;
}
项目:dsl-devkit    文件:ContextActionUiTestUtil.java   
/**
 * Returns the {@link SWTBotMenu}s available on the given widget bot.
 *
 * @param widgetBot
 *          the bot representing the widget, whose {@link SWTBotMenu}s should be returned
 * @return the {@link SWTBotMenu}s on the given widget bot
 */
public static List<SWTBotMenu> getContextMenuItems(final AbstractSWTBot<? extends Control> widgetBot) {
  return UIThreadRunnable.syncExec(new Result<List<SWTBotMenu>>() {
    @Override
    public List<SWTBotMenu> run() {
      List<SWTBotMenu> menuItems = Lists.newArrayList();
      for (MenuItem menuItem : new ContextMenuFinder(widgetBot.widget).findMenus(widgetBot.widget.getShell(), WidgetMatcherFactory.widgetOfType(MenuItem.class), true)) {
        menuItems.add(new SWTBotMenu(menuItem));
      }
      return menuItems;
    }
  });
}
项目:dsl-devkit    文件:ContextActionUiTestUtil.java   
/**
 * Returns the disabled {@link SWTBotMenu}s on the given widget bot.
 *
 * @param widgetBot
 *          the bot representing the widget, whose disabled {@link SWTBotMenu}s should be returned
 * @return the disabled {@link SWTBotMenu}s on the given widget bot
 */
public static List<SWTBotMenu> getDisabledContextMenuItems(final AbstractSWTBot<? extends Control> widgetBot) {
  return UIThreadRunnable.syncExec(new Result<List<SWTBotMenu>>() {
    @Override
    public List<SWTBotMenu> run() {
      List<SWTBotMenu> disabledMenuItems = Lists.newArrayList();
      for (MenuItem menuItem : new ContextMenuFinder(widgetBot.widget).findMenus(widgetBot.widget.getShell(), WidgetMatcherFactory.widgetOfType(MenuItem.class), true)) {
        if (!menuItem.isEnabled()) {
          disabledMenuItems.add(new SWTBotMenu(menuItem));
        }
      }
      return disabledMenuItems;
    }
  });
}
项目:gwt-eclipse-plugin    文件:ActiveShellMenu.java   
@Override
public boolean test() throws Exception {
  MenuFinder finder = getMenuFinder();
  SwtBotUtils.print("ActiveShellMenu: Getting menus for shell: " + bot.activeShell().getText());
  SwtBotUtils.print("ActiveShellMenu: Is active: " + bot.activeShell().isActive() + "");

  Matcher<MenuItem> menuMatcher = WidgetMatcherFactory.withMnemonic(name);
  Shell shell = bot.activeShell().widget;
  found = finder.findMenus(shell, menuMatcher, recursive);

  boolean hasFound = found != null && found.size() > 0;
  SwtBotUtils.print("ActiveShellMenu: Has found menus: '" + hasFound + "' for: " + name);
  return hasFound;
}
项目:gw4e.project    文件:GW4EPreferencePage.java   
private void showGW4EPreference(SWTBotShell shell) {
    bot.tree().select("GW4E Preferences");
    Matcher<Shell> matcher = WidgetMatcherFactory.withId("id", PreferenceManager.AUTHORIZED_FOLDERS_FOR_GRAPH_DEFINITION);
    bot.waitUntil(Conditions.waitForWidget(matcher, shell.widget));
}
项目:dsl-devkit    文件:WaitForTable.java   
/**
 * Creates a new instance of {@link WaitForTable}.
 *
 * @param parent
 *          the parent {@link Table}, must not be {@code null}
 */
public WaitForTable(final Table parent) {
  super(WidgetMatcherFactory.widgetOfType(TableItem.class));
  Assert.isNotNull(parent, "parent");
  this.parent = parent;
}
项目:dsl-devkit    文件:WaitForTree.java   
/**
 * Creates a new instance of {@link WaitForTree}.
 *
 * @param parent
 *          the parent {@link Tree}, must not be {@code null}
 */
public WaitForTree(final Tree parent) {
  super(WidgetMatcherFactory.widgetOfType(TreeItem.class));
  Assert.isNotNull(parent, "parent");
  this.parent = parent;
}