Package net.sf.swtbot.finder.UIThreadRunnable

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


    checkEnabled();

    if (hasStyle(widget, SWT.READ_ONLY))
      throw new RuntimeException("This combo box is read-only.");

    asyncExec(new VoidResult() {
      public void run() {
        getCombo().setText(text);
      }
    });
    notify(SWT.Modify);
View Full Code Here


    if (!isChecked()) {
      if (log.isDebugEnabled())
        log.debug("Widget " + SWTUtils.toString(widget) + " already deselected, not deselecting again.");
      return;
    }
    asyncExec(new VoidResult() {
      public void run() {
        if (log.isDebugEnabled())
          log.debug("Deselecting " + widget);
        ((Button) widget).setSelection(false);
      }
View Full Code Here

    if (isChecked()) {
      if (log.isDebugEnabled())
        log.debug("Widget " + SWTUtils.toString(widget) + " already selected, not selecting again.");
      return;
    }
    asyncExec(new VoidResult() {
      public void run() {
        if (log.isDebugEnabled())
          log.debug("Selecting " + widget);
        ((Button) widget).setSelection(true);
      }
View Full Code Here

  /**
   * Toggle the checkbox.
   */
  protected void toggle() {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        Button b = (Button) widget;
        if (log.isDebugEnabled())
          log.debug("Toggling state on " + b + ". Setting state to " + (!b.getSelection() ? "selected" : "unselected"));
        b.setSelection(!b.getSelection());
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Setting text on widget " + SWTUtils.getText(widget) + " to " + text);
    checkEnabled();
    if (hasStyle(widget, SWT.READ_ONLY))
      throw new RuntimeException("This combo box is read-only.");
    asyncExec(new VoidResult() {
      public void run() {
        getCCombo().setText(text);
      }
    });
    notify(SWT.Modify);
View Full Code Here

        return Arrays.asList(items).indexOf(text);
      }
    });
    if (indexOf == -1)
      throw new RuntimeException("Item `" + text + "' not found in combo box.");
    asyncExec(new VoidResult() {
      public void run() {
        getCCombo().select(indexOf);
      }
    });
  }
View Full Code Here

    checkEnabled();
    int itemCount = itemCount();
    if (index > itemCount)
      throw new RuntimeException("The index (" + index + ") is more than the number of items (" + itemCount + ") in the combo.");

    asyncExec(new VoidResult() {
      public void run() {
        getCCombo().select(index);
      }
    });
  }
View Full Code Here

  public void activate() throws TimeoutException {
    if (log.isTraceEnabled())
      log.trace("Activating " + SWTUtils.toString(getTabItem()));
    checkEnabled();
    // this runs in sync because tabFolder.setSelection() does not send a notification, and so should not block.
    asyncExec(new VoidResult() {
      public void run() {
        TabItem tabItem = getTabItem();
        tabItem.getParent().setSelection(tabItem);
        if (log.isDebugEnabled())
          log.debug("Activated " + tabItem);
View Full Code Here

  /**
   * Registers this finder so that it may start 'looking for' controls. It does so by listening for {@link SWT#Show}
   * and {@link SWT#Hide} events on menus.
   */
  public void register() {
    UIThreadRunnable.syncExec(display, new VoidResult() {
      public void run() {
        display.addFilter(SWT.Show, showHideListener);
        display.addFilter(SWT.Hide, showHideListener);
      }
    });
View Full Code Here

  /**
   * Unregisters this finder so that it may stop 'looking for' controls. It does so by listening for {@link SWT#Show}
   * and {@link SWT#Hide} events on menus.
   */
  public void unregister() {
    UIThreadRunnable.syncExec(display, new VoidResult() {
      public void run() {
        display.removeFilter(SWT.Show, showHideListener);
        display.removeFilter(SWT.Hide, showHideListener);
      }
    });
View Full Code Here

TOP

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

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.