Package net.sf.swtbot.finder.UIThreadRunnable

Examples of net.sf.swtbot.finder.UIThreadRunnable.WidgetResult


   * @see net.sf.swtbot.finder.MenuFinder#menuBar(org.eclipse.swt.widgets.Shell)
   * @param shell The shell to find the menu bar for.
   * @return The menu bar found.
   */
  protected Menu menuBar(final Shell shell) {
    return (Menu) UIThreadRunnable.syncExec(display, new WidgetResult() {
      public Widget run() {
        return control.getMenu();
      }
    });
  }
View Full Code Here


   * @param shell the shell.
   * @return the menu in the shell.
   * @see Shell#getMenuBar()
   */
  protected Menu menuBar(final Shell shell) {
    return (Menu) UIThreadRunnable.syncExec(display, new WidgetResult() {
      public Widget run() {
        return shell.getMenuBar();
      }
    });

View Full Code Here

   *
   * @return the active shell.
   * @see Display#getActiveShell()
   */
  public Shell activeShell() {
    Shell activeShell = (Shell) UIThreadRunnable.syncExec(display, new WidgetResult() {
      public Widget run() {
        return display.getActiveShell();
      }
    });
    if (activeShell != null)
      return activeShell;
    return (Shell) UIThreadRunnable.syncExec(display, new WidgetResult() {
      public Widget run() {
        Shell[] shells = getShells();
        for (int i = 0; i < shells.length; i++)
          if (shells[i].isFocusControl())
            return shells[i];
View Full Code Here

   * @param composite The composite to use.
   * @return The {@link StyledText} item.
   */
  private StyledText findEditor(final Composite composite) {
    final ClassMatcher classMatcher = new ClassMatcher(StyledText.class);
    return (StyledText) syncExec(new WidgetResult() {
      public Widget run() {
        StyledText styledText = null;
        try {
          List findControls = finder.findControls(composite, classMatcher, true);
          styledText = (StyledText) findControls.get(0);
View Full Code Here

   *
   * @param nodeText the text on the node.
   * @return the tree item with the specified text.
   */
  private TreeItem getItem(final String nodeText) {
    return (TreeItem) syncExec(new WidgetResult() {
      public Widget run() {
        TreeItem[] items = getControl().getItems();
        for (int i = 0; i < items.length; i++) {
          TreeItem item = items[i];
          if (item.getText().equals(nodeText))
View Full Code Here

   * @param parent
   * @param index
   * @return the widget at the specified position in the specified parent
   */
  Widget getWidget(final Widget parent, final int index) {
    return UIThreadRunnable.syncExec(parent.getDisplay(), new WidgetResult() {
      public Widget run() {
        return (Widget) getChildrenResolver().getChildren(parent).get(index);
      }
    });
  }
View Full Code Here

   * Gets the tab folder.
   *
   * @return The {@link TabFolder}.
   */
  private TabFolder tabFolder() {
    return (TabFolder) syncExec(new WidgetResult() {
      public Widget run() {
        return getTabItem().getParent();
      }
    });
  }
View Full Code Here

   * @param menuName the name of the menu item that is to be found
   * @return the first menu that matches the menuName
   * @throws WidgetNotFoundException if the widget is not found.
   */
  public SWTBotMenu menu(final String menuName) throws WidgetNotFoundException {
    MenuItem menuItem = (MenuItem) syncExec(new WidgetResult() {
      public Widget run() {
        Menu bar = ((MenuItem) widget).getMenu();
        List findMenus = new MenuFinder().findMenus(bar, WidgetMatcherFactory.menuMatcher(menuName), true);
        if (!findMenus.isEmpty())
          return (MenuItem) findMenus.get(0);
View Full Code Here

   * @param text the text on the column.
   * @return the {@link TableColumn} with the specified text.
   * @throws WidgetNotFoundException if the column is not found.
   */
  protected static Widget findColumn(final Table table, final String text) throws WidgetNotFoundException {
    TableColumn tableColumn = (TableColumn) UIThreadRunnable.syncExec(table.getDisplay(), new WidgetResult() {
      public Widget run() {
        TableColumn[] columns = table.getColumns();
        for (int i = 0; i < columns.length; i++) {
          TableColumn tableColumn = columns[i];
          if (tableColumn.getText().equals(text))
View Full Code Here

      }
    });
  }

  private ExpandItem getItem(final String nodeText) {
    return (ExpandItem) syncExec(new WidgetResult() {
      public Widget run() {
        ExpandItem[] items = getControl().getItems();
        for (int i = 0; i < items.length; i++) {
          ExpandItem item = items[i];
          if (item.getText().equals(nodeText))
View Full Code Here

TOP

Related Classes of net.sf.swtbot.finder.UIThreadRunnable.WidgetResult

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.