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

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


            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

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

      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

  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

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

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

          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

        List<SWTBotCommand> command = finder.findCommand(equalTo(label));
        return command.get(index);
      }
      return menuItems.get(index);
    } catch (Exception e) {
      throw new WidgetNotFoundException("Could not find view menu with label " + label + " at index " + index, e); //$NON-NLS-1$ //$NON-NLS-2$
    }
  }
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.