Package net.sf.swtbot.finder.UIThreadRunnable

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


  public String getFailureMessage() {
    return "The shell " + shell + " did not close.";
  }

  public boolean test() throws Exception {
    return UIThreadRunnable.syncExec(new BoolResult() {
      public boolean run() {
        return shell.widget.isDisposed() || !((Shell) shell.widget).isVisible();
      }
    });
  }
View Full Code Here


   * Gets if the checkbox button is checked.
   *
   * @return <code>true</code> if the checkbox is checked. Otherwise <code>false</code>.
   */
  public boolean isChecked() {
    return syncExec(new BoolResult() {
      public boolean run() {
        return ((Button) widget).getSelection();
      }
    });
  }
View Full Code Here

   * @return <code>true</code> if the widget has the specified style bit set. Otherwise <code>false</code>.
   */
  public static boolean hasStyle(final Widget w, final int style) {
    if ((w == null) || w.isDisposed())
      return false;
    return UIThreadRunnable.syncExec(w.getDisplay(), new BoolResult() {
      public boolean run() {
        return (w.getStyle() & style) != 0;
      }
    });
  }
View Full Code Here

   * @param fileName the filename to save screenshot to.
   * @return <code>true</code> if the screenshot was created and saved, <code>false</code> otherwise.
   * @since 1.0
   */
  public static boolean captureScreenshot(final String fileName) {
    return UIThreadRunnable.syncExec(new BoolResult() {
      public boolean run() {
        return captureScreenshotInternal(fileName);
      }
    });
  }
View Full Code Here

  /**
   * @return <code>true</code> if the tab item is active, <code>false</code> otherwise.
   */
  public boolean isActive() {
    return syncExec(new BoolResult() {
      public boolean run() {
        return tabFolder().getSelection()[0] == widget;
      }
    });
  }
View Full Code Here

      }
    });
  }

  public boolean isEnabled() {
    return syncExec(new BoolResult() {
      public boolean run() {
        return getTabItem().getParent().isEnabled();
      }
    });
  }
View Full Code Here

   *
   * @return <code>true</code> if the tree has any items, <code>false</code> otherwise.
   * @since 1.0
   */
  public boolean hasItems() {
    return syncExec(new BoolResult() {
      public boolean run() {
        return getControl().getItemCount() > 0;
      }
    });
  }
View Full Code Here

   * @return <code>true</code> if the widget is enabled.
   * @see Control#isEnabled()
   */
  public boolean isEnabled() {
    if (widget instanceof Control)
      return syncExec(new BoolResult() {
        public boolean run() {
          return isEnabledInternal();
        }
      });
    return false;
View Full Code Here

   *
   * @return <code>true</code> if the widget is visible, <code>false</code> otherwise.
   * @since 1.0
   */
  public boolean isVisible() {
    return syncExec(new BoolResult() {
      public boolean run() {
        if (widget instanceof Control)
          return ((Control) widget).isVisible();
        return true;
      }
View Full Code Here

   *
   * @since 1.2
   */
  public void setFocus() {
    checkEnabled();
    boolean focusSet = syncExec(new BoolResult() {
      public boolean run() {
        if (widget instanceof Control)
          return ((Control) widget).setFocus();
        return true;
      }
View Full Code Here

TOP

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

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.