Package org.eclipse.swtbot.swt.finder.results

Examples of org.eclipse.swtbot.swt.finder.results.BoolResult


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


  public String getFailureMessage() {
    return "The shell " + shell + " did not close."; //$NON-NLS-1$ //$NON-NLS-2$
  }

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

  }

  public boolean test() throws Exception {
    try {
      final SWTBotShell shell = bot.shell(text);
      return UIThreadRunnable.syncExec(new BoolResult() {
        public Boolean run() {
          return shell.widget.isVisible() || shell.widget.isFocusControl();
        }
      });
    } catch (WidgetNotFoundException e) {
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 widget.getItemCount() > 0;
      }
    });
  }
View Full Code Here

  public static boolean hasStyle(final Widget w, final int style) {
    if ((w == null) || w.isDisposed())
      return false;
    if (style == SWT.NONE)
      return true;
    return UIThreadRunnable.syncExec(w.getDisplay(), new BoolResult() {
      public Boolean run() {
        return (w.getStyle() & style) != 0;
      }
    });
  }
View Full Code Here

   * @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) {
    new ImageFormatConverter().imageTypeOf(fileName.substring(fileName.lastIndexOf('.') + 1));
    return UIThreadRunnable.syncExec(new BoolResult() {
      public Boolean run() {
        return captureScreenshotInternal(fileName);
      }
    });
  }
View Full Code Here

   * @return <code>true</code> if the screenshot was created and saved, <code>false</code> otherwise.
   * @since 2.0
   */
  public static boolean captureScreenshot(final String fileName, final Control control) {
    new ImageFormatConverter().imageTypeOf(fileName.substring(fileName.lastIndexOf('.') + 1));
    return UIThreadRunnable.syncExec(new BoolResult() {
      public Boolean run() {
        Display display = control.getDisplay();
        Rectangle bounds = control.getBounds();
        Rectangle mappedToDisplay = display.map(control.getParent(), null, bounds);

View Full Code Here

   * @return <code>true</code> if the screenshot was created and saved, <code>false</code> otherwise.
   * @since 2.0
   */
  public static boolean captureScreenshot(final String fileName, final Rectangle bounds) {
    new ImageFormatConverter().imageTypeOf(fileName.substring(fileName.lastIndexOf('.') + 1));
    return UIThreadRunnable.syncExec(new BoolResult() {
      public Boolean run() {
        return captureScreenshotInternal(fileName, bounds);
      }
    });
  }
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

TOP

Related Classes of org.eclipse.swtbot.swt.finder.results.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.