Examples of WidgetNotFoundException


Examples of net.sf.swtbot.widgets.WidgetNotFoundException

   * @since 1.0
   */
  public SWTBotText text(String text, int index) throws WidgetNotFoundException {
    List findControls = finder.findControls(new DecoratingAndMatcher(new ClassMatcher(Text.class), new TextMatcher(text)));
    if (findControls.isEmpty())
      throw new WidgetNotFoundException("Could not find any text widget");
    return new SWTBotText((Text) findControls.get(index));
  }
View Full Code Here

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

        }
        return results;
      }
    });
    if (foundItems.isEmpty())
      throw new WidgetNotFoundException("Could not find node with text: " + nodeText); //$NON-NLS-1$
    return foundItems;
  }
View Full Code Here

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

            if ( item.cell( 0 ).equals( attributeType ) && item.cell( 1 ).equals( value ) )
            {
                return item;
            }
        }
        throw new WidgetNotFoundException( "Attribute " + attributeType + ":" + value + " not found." );
    }
View Full Code Here

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

   * @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

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

   */
  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

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

      finder.register();
      notify(SWT.MenuDetect);
      Matcher<MenuItem> withMnemonic = withMnemonic(label);
      List<MenuItem> menus = finder.findMenus(withMnemonic);
      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

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

  public void waitUntilWidgetAppears(ICondition waitForWidget) {
    try {
      waitUntil(waitForWidget);
    } catch (TimeoutException e) {
      throw new WidgetNotFoundException("Could not find widget.", e); //$NON-NLS-1$
    }
  }
View Full Code Here

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

   */
  @SuppressWarnings("unchecked")
  public SWTBotTrayItem trayItemWithTooltip(String tooltip, int index) {
    java.util.List<SWTBotTrayItem> items = trayItems(allOf(widgetOfType(TrayItem.class), withTooltip(tooltip)));
    if (items.isEmpty() || items.size() <= index)
      throw new WidgetNotFoundException("Widget does not contain an item at index " + index);
    return items.get(index);
  }
View Full Code Here

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

      public Tray run() {
        return SWTUtils.display().getSystemTray();
      }
    });
    if (tray == null) {
      throw new WidgetNotFoundException("no system tray found");
    }
    return tray;
  }
View Full Code Here

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

          return null;
        }
      }
    });
    if (editor == null)
      throw new WidgetNotFoundException("There is no active editor"); //$NON-NLS-1$
    return new SWTBotEclipseEditor(editor, this);
  }
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.