Package net.sf.swtbot.finder.UIThreadRunnable

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


   */
  protected void notify(final int eventType, final Event createEvent, final Widget widget) {
    final String eventString = SWTBotEvents.toString(eventType) + createEvent.toString();
    if (log.isTraceEnabled())
      log.trace("Enquing event " + eventString + " on " + SWTUtils.toString(widget));
    asyncExec(new VoidResult() {
      public void run() {
        if ((widget == null) || widget.isDisposed()) {
          if (log.isTraceEnabled())
            log.trace("Not notifying " + SWTUtils.toString(widget) + " is null or has been disposed");
          return;
        }
        if (!isEnabledInternal()) {
          log.warn("Widget is not enabled: " + SWTUtils.toString(widget));
          return;
        }
        if (log.isTraceEnabled())
          log.trace("Sending event " + eventString + " to " + widget);
        widget.notifyListeners(eventType, createEvent);
        if (log.isDebugEnabled())
          log.debug("Sent event " + eventString + " to " + widget);
      }
    });

    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        // do nothing, just wait for sync.
      }
    });

View Full Code Here


   * @param expandItem the widget.
   * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
   */
  public SWTBotExpandItem(final ExpandItem expandItem) throws WidgetNotFoundException {
    super(expandItem);
    syncExec(new VoidResult() {
      public void run() {
        widget = expandItem.getParent();
      }
    });
    this.expandItem = expandItem;
View Full Code Here

  /**
   * @return the expandBar item, after expanding it.
   */
  public SWTBotExpandItem expand() {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        getExpandItem().setExpanded(true);
        expandNotify();
      }
    });
View Full Code Here

  /**
   * @return the expandBar item, after unExpanding it.
   */
  public SWTBotExpandItem unExpand() {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        getExpandItem().setExpanded(false);
        expandNotify();
      }
    });
View Full Code Here

   *
   * @param text the text to be set.
   */
  public void setText(final String text) {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        getControl().setText(text);
      }
    });
  }
View Full Code Here

   */
  protected void notify(final int eventType, final Event createEvent, final Widget widget) {
    final String eventString = SWTBotEvents.toString(eventType) + createEvent.toString();
    if (log.isTraceEnabled())
      log.trace("Enquing event " + eventString + " on " + SWTUtils.toString(widget));
    asyncExec(new VoidResult() {
      public void run() {
        if ((widget == null) || widget.isDisposed()) {
          if (log.isTraceEnabled())
            log.trace("Not notifying " + SWTUtils.toString(widget) + " is null or has been disposed");
          return;
        }
        if (!isEnabledInternal()) {
          log.warn("Widget is not enabled: " + SWTUtils.toString(widget));
          return;
        }
        if (log.isTraceEnabled())
          log.trace("Sending event " + eventString + " to " + widget);
        widget.notifyListeners(eventType, createEvent);
        if (log.isDebugEnabled())
          log.debug("Sent event " + eventString + " to " + widget);
      }
    });
   
    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        // do nothing, just wait for sync.
      }
    });
   
View Full Code Here

   *
   * @param rowIndex the zero-based index of the row to be selected.
   */
  public void select(final int rowIndex) {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        if (log.isDebugEnabled())
          log.debug("Selecting row [" + rowIndex + "] " + getControl().getItem(rowIndex).getText() + " in " + widget);
        getControl().setSelection(rowIndex);
      }
View Full Code Here

   * @since 1.0
   */
  public void select(final String item) {
    checkEnabled();
    final int indexOf = indexOf(item);
    asyncExec(new VoidResult() {
      public void run() {
        getControl().setSelection(indexOf);
      }
    });
    notifySelect();
View Full Code Here

  /**
   * Unselect all selections.
   */
  public void unselect() {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        if (log.isDebugEnabled())
          log.debug("Unselecting all in " + widget);
        getControl().deselectAll();
      }
View Full Code Here

   *
   * @param indices the row indices to select in the table.
   */
  public void select(final int[] indices) {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        if (log.isDebugEnabled()) {
          StringBuffer message = new StringBuffer("Selecting rows ");
          for (int i = 0; i < indices.length; i++)
            message.append(indices[i]);
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.