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

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


   * @param toYPosition the y relative position
   */
  public void drag(final String label, final int toXPosition, final int toYPosition) {
    SWTBotGefEditPart selectedEP = getEditPart(label);
    if (selectedEP == null) {
      throw new WidgetNotFoundException(String.format("Expected to find widget %s", label));
    }
    drag(selectedEP, toXPosition, toYPosition);
  }
View Full Code Here


   * select the edit part with the label as a single selection.
   */
  public SWTBotGefViewer select(String label) {
    SWTBotGefEditPart selectedEP = getEditPart(label);
    if (selectedEP == null) {
      throw new WidgetNotFoundException(String.format("Expected to find widget %s", label));
    }
    List<SWTBotGefEditPart> editParts = new ArrayList<SWTBotGefEditPart>();
    editParts.add(selectedEP);
    return select(selectedEP);
  }
View Full Code Here

      public void run() {
        // do nothing, just wait for all events to be processed
      }
    });
    if (!clicked[0]) {
      throw new WidgetNotFoundException(text);
    }
    return this;
  }
View Full Code Here

        public void run() {
          action.run();
        }
      });
    else
      throw new WidgetNotFoundException("There is no action or contribution id to execute."); //$NON-NLS-1$
  }
View Full Code Here

      /* NOOP, means that it is not an editor. Search for a view instead then.*/
      try {
        editorOrView = gefView(partTitle);
      } catch (WidgetNotFoundException e) {
        /* It's not a view either! */
        throw new WidgetNotFoundException("Unable to find a part with title " + partTitle);
      }
    }
    if (editorOrView instanceof SWTBotGefEditor) {
      return ((SWTBotGefEditor) editorOrView).getSWTBotGefViewer();
    } else {
View Full Code Here

    for (MenuItem menuItem : findMenus) {
      result.add(new SWTBotMenu(menuItem, matcher));
    }

    if (result.isEmpty())
      throw new WidgetNotFoundException("Could not find a menu item"); //$NON-NLS-1$
    return result;
  }
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

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

        public boolean test() throws Exception {
          return getItem(row) != null;
        }
      });
    } catch (TimeoutException e) {
      throw new WidgetNotFoundException("Timed out waiting for table item in row " + row, e); //$NON-NLS-1$
    }
    return new SWTBotTableItem(getItem(row));
  }
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

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.