Examples of SWTBot


Examples of org.eclipse.swtbot.swt.finder.SWTBot

  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 {
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

      notify(SWT.Deactivate);
      notify(SWT.FocusOut);
      log.debug(MessageFormat.format("Clicked on {0}", this)); //$NON-NLS-1$

      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 {
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

   * @return the tree item with the specified text.
   * @throws WidgetNotFoundException if the node was not found.
   */
  public SWTBotTreeItem getTreeItem(final String nodeText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + nodeText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

   */
  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 {
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

    mnemonicTextMatcher = new WithMnemonic<Widget>(labelText);
    this.parent = parent;
  }

  protected boolean doMatch(Object obj) {
    List<? extends Widget> allWidgets = new SWTBot().widgets(anything(), parent(obj));

    int widgetIndex = allWidgets.indexOf(obj);

    ListIterator<? extends Widget> listIterator = allWidgets.listIterator(widgetIndex);
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

   * Returns a SWTBot instance that matches the contents of this workbench part.
   *
   * @return SWTBot
   */
  public SWTBot bot() {
    return new SWTBot(getControl());
  }
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

  public WithLabel(String labelText) {
    mnemonicTextMatcher = new WithMnemonic<Widget>(labelText);
  }

  protected boolean doMatch(Object obj) {
    List<? extends Widget> allWidgets = new SWTBot().widgets(anything(), ((Control) obj).getShell());

    int widgetIndex = allWidgets.indexOf(obj);

    ListIterator<? extends Widget> listIterator = allWidgets.listIterator(widgetIndex);
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

   * @return the tree item with the specified text.
   * @throws WidgetNotFoundException if the node was not found.
   */
  public SWTBotTreeItem getTreeItem(final String nodeText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + nodeText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

   * @throws WidgetNotFoundException if the node was not found.
   * @since 1.3
   */
  public SWTBotTableItem getTableItem(final String itemText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + itemText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

Examples of org.eclipse.swtbot.swt.finder.SWTBot

   * @throws WidgetNotFoundException if the node was not found.
   * @since 2.0
   */
  public SWTBotTableItem getTableItem(final int row) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find table item for row " + row; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.