Package org.eclipse.swtbot.swt.finder.exceptions

Examples of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException


      if (item.getToolTipText().equals(tooltip)) {
        return item;
      }
    }

    throw new WidgetNotFoundException("Unable to find toolitem with the given tooltip '" + tooltip + "'"); //$NON-NLS-1$ //$NON-NLS-2$
  }
View Full Code Here


    boolean shouldFindInvisibleControls = finder.shouldFindInvisibleControls();
    finder.setShouldFindInvisibleControls(true);
    try {
      return bot.widget(matcher, control);
    } catch (Exception e) {
      throw new WidgetNotFoundException("Could not find any control inside the view " + partReference.getPartName(), e); //$NON-NLS-1$
    } finally {
      finder.setShouldFindInvisibleControls(shouldFindInvisibleControls);
    }
  }
View Full Code Here

      Matcher<? extends Widget> matcher = withMnemonic(menuItem);
      List<?> findMenus = menuFinder.findMenus(new SWTBot().activeShell().widget, matcher, true);
      log.debug(findMenus);
      if (findMenus.isEmpty())
        throw new WidgetNotFoundException("Could not find a menu item"); //$NON-NLS-1$
      return new SWTBotMenu((MenuItem) findMenus.get(0), matcher);
    } finally {
      menuFinder.unregister();
    }
  }
View Full Code Here

        public boolean test() throws Exception {
          return getItem(nodeText) != null;
        }
      });
    } catch (TimeoutException e) {
      throw new WidgetNotFoundException("Timed out waiting for tree item " + nodeText, e); //$NON-NLS-1$
    }
    return new SWTBotTreeItem(getItem(nodeText));
  }
View Full Code Here

   * @param description the description of the widget, this will be reported by {@link #toString()}
   * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
   */
  public AbstractSWTBot(T w, SelfDescribing description) throws WidgetNotFoundException {
    if (w == null)
      throw new WidgetNotFoundException("The widget was null."); //$NON-NLS-1$

    this.widget = w;
    if (description == null)
      this.description = new WidgetTextDescription(w);
    else
      this.description = description;

    if (w.isDisposed())
      throw new WidgetNotFoundException("The widget {" + description + "} was disposed." + SWTUtils.toString(w)); //$NON-NLS-1$ //$NON-NLS-2$

    display = w.getDisplay();
    log = Logger.getLogger(getClass());
  }
View Full Code Here

   */
  public SWTBotMenu contextMenu(final String text) throws WidgetNotFoundException {
    if (widget instanceof Control) {
      return contextMenu((Control) widget, text);
    }
    throw new WidgetNotFoundException("Could not find menu: " + text); //$NON-NLS-1$
  }
View Full Code Here

   * @throws WidgetNotFoundException if there is no active view
   */
  public SWTBotView activeView() {
    IViewReference view = workbenchContentsFinder.findActiveView();
    if (view == null)
      throw new WidgetNotFoundException("There is no active view"); //$NON-NLS-1$
    return new SWTBotView(view, this);
  }
View Full Code Here

   * @throws WidgetNotFoundException if there is no active view
   */
  public SWTBotEditor activeEditor() {
    IEditorReference editor = workbenchContentsFinder.findActiveEditor();
    if (editor == null)
      throw new WidgetNotFoundException("There is no active editor"); //$NON-NLS-1$
    return new SWTBotEditor(editor, this);
  }
View Full Code Here

   * @return the active perspective in the active workbench page
   */
  public SWTBotPerspective activePerspective() {
    IPerspectiveDescriptor perspective = workbenchContentsFinder.findActivePerspective();
    if (perspective == null)
      throw new WidgetNotFoundException("There is no active perspective"); //$NON-NLS-1$
    return new SWTBotPerspective(perspective, this);
  }
View Full Code Here

    try {
      finder.register();
      notify(SWT.MenuDetect);
      List<MenuItem> menus = finder.findMenus(withMnemonic(label));
      if (menus.isEmpty())
        throw new WidgetNotFoundException("Could not find a menu item");
      return new SWTBotMenu(menus.get(0));
    } finally {
      finder.unregister();
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException

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.