Package org.eclipse.swtbot.swt.finder.finders

Examples of org.eclipse.swtbot.swt.finder.finders.ContextMenuFinder


  @SuppressWarnings("unchecked")
  // varargs and generics doesn't mix well!
  protected SWTBotMenu contextMenu(final Control control, final String text) {
    Matcher<MenuItem> withMnemonic = withMnemonic(text);
    final Matcher<MenuItem> matcher = allOf(widgetOfType(MenuItem.class), withMnemonic);
    final ContextMenuFinder menuFinder = new ContextMenuFinder(control);

    new SWTBot().waitUntil(new DefaultCondition() {
      public String getFailureMessage() {
        return "Could not find context menu with text: " + text; //$NON-NLS-1$
      }

      public boolean test() throws Exception {
        return !menuFinder.findMenus(matcher).isEmpty();
      }
    });
    return new SWTBotMenu(menuFinder.findMenus(matcher).get(0), matcher);
  }
View Full Code Here


   * @throws WidgetNotFoundException if the widget is not found.
   * @since 2.0
   */
  protected SWTBotMenu contextMenu(final Control control, final String text) {
    final Matcher<?> matcher = allOf(instanceOf(MenuItem.class), withMnemonic(text));
    final ContextMenuFinder menuFinder = new ContextMenuFinder(control);

    new SWTBot().waitUntil(new DefaultCondition() {
      public String getFailureMessage() {
        return "Could not find context menu with text: " + text; //$NON-NLS-1$
      }

      public boolean test() throws Exception {
        return !menuFinder.findMenus(matcher).isEmpty();
      }
    });
    return new SWTBotMenu(menuFinder.findMenus(matcher).get(0), matcher);
  }
View Full Code Here

   * @throws WidgetNotFoundException if the widget is not found.
   * @since 2.0
   */
  protected SWTBotMenu contextMenu(final Control control, final String text) {
    final Matcher<?> matcher = allOf(instanceOf(MenuItem.class), withMnemonic(text));
    final ContextMenuFinder menuFinder = new ContextMenuFinder(control);

    new SWTBot().waitUntil(new DefaultCondition() {
      public String getFailureMessage() {
        return "Could not find context menu with text: " + text; //$NON-NLS-1$
      }

      public boolean test() throws Exception {
        return !menuFinder.findMenus(matcher).isEmpty();
      }
    });
    return new SWTBotMenu(menuFinder.findMenus(matcher).get(0), matcher);
  }
View Full Code Here

    public SWTBotContextMenu click(final String text) {
        showContextMenu(text);
       
        Matcher<MenuItem> withMnemonic = WidgetMatcherFactory.withMnemonic(text);
        final Matcher<MenuItem> matcher = WidgetMatcherFactory.allOf(WidgetMatcherFactory.widgetOfType(MenuItem.class), withMnemonic);
        final ContextMenuFinder menuFinder = new FirstContextMenuFinder(tree);
       
        final List<MenuItem> items = new ArrayList<MenuItem>();

        new SWTBot().waitUntil(new DefaultCondition() {
            public String getFailureMessage() {
                return "Could not find context menu with text: " + text; //$NON-NLS-1$
            }

            public boolean test() throws Exception {
                items.addAll(menuFinder.findMenus(matcher));
                return !items.isEmpty();
            }
        });
       
        MenuItem menuItem = items.get(0);
View Full Code Here

  @SuppressWarnings("unchecked")
  // varargs and generics doesn't mix well!
  protected SWTBotMenu contextMenu(final Control control, final String text) {
    Matcher<MenuItem> withMnemonic = withMnemonic(text);
    final Matcher<MenuItem> matcher = allOf(widgetOfType(MenuItem.class), withMnemonic);
    final ContextMenuFinder menuFinder = new ContextMenuFinder(control);

    new SWTBot().waitUntil(new DefaultCondition() {
      public String getFailureMessage() {
        return "Could not find context menu with text: " + text; //$NON-NLS-1$
      }

      public boolean test() throws Exception {
        return !menuFinder.findMenus(matcher).isEmpty();
      }
    });
    return new SWTBotMenu(menuFinder.findMenus(matcher).get(0), matcher);
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.finders.ContextMenuFinder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.