Package net.sf.swtbot.finder.UIThreadRunnable

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


   */
  public void click(final int row, final int column) {
    assertIsLegalCell(row, column);
    // for some reason, it does not work without setting selection first
    select(row);
    asyncExec(new VoidResult() {
      public void run() {
        TableItem item = getControl().getItem(row);
        Rectangle cellBounds = item.getBounds(column);
        clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2));
      }
View Full Code Here


   * @since 1.2
   */
  public void doubleClick(final int row, final int column) {
    assertIsLegalCell(row, column);

    asyncExec(new VoidResult() {
      public void run() {
        TableItem item = getControl().getItem(row);
        Rectangle cellBounds = item.getBounds(column);
        // for some reason, it does not work without setting selection first
        getControl().setSelection(row);
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Set selection " + SWTUtils.toString(widget) + " to text " + item);
    checkEnabled();
    final int indexOf = indexOf(item);
    Assert.isTrue(indexOf != -1, "Item `" + item + "' not found in list.");
    asyncExec(new VoidResult() {
      public void run() {
        getList().setSelection(indexOf);
      }
    });
    notifySelect();
View Full Code Here

    if (log.isDebugEnabled())
      log.debug("Set selection " + SWTUtils.toString(widget) + " to index " + index);
    checkEnabled();
    int itemCount = itemCount();
    Assert.isTrue(index <= itemCount, "The index (" + index + ") is more than the number of items (" + itemCount + ") in the list.");
    asyncExec(new VoidResult() {
      public void run() {
        getList().setSelection(index);
      }
    });
    notifySelect();
View Full Code Here

   */
  public void select(final int[] indices) {
    if (log.isDebugEnabled())
      log.debug("Set selection " + SWTUtils.toString(widget) + " to indices " + StringUtils.join(indices, ", ") + "]");
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        getList().setSelection(indices);
      }

    });
View Full Code Here

   */
  public void select(final String[] items) {
    if (log.isDebugEnabled())
      log.debug("Set selection " + SWTUtils.toString(widget) + " to items [" + StringUtils.join(items, ", ") + "]");
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        getList().deselectAll();
        for (int i = 0; i < items.length; i++) {
          int index = getList().indexOf(items[i]);
          if (index != -1)
View Full Code Here

  /**
   * Unselects everything.
   */
  public void unselect() {
    asyncExec(new VoidResult() {
      public void run() {
        getList().deselectAll();
      }
    });
    notifySelect();
View Full Code Here

   */
  public void setDate(final Date toSet) {
    if (log.isDebugEnabled())
      log.debug("Setting date on control: " + SWTUtils.toString(widget) + " to " + toSet);
    checkEnabled();
    syncExec(new VoidResult() {
      public void run() {
        getControl().setYear(toSet.getYear() + 1900);
        getControl().setMonth(toSet.getMonth());
        getControl().setDay(toSet.getDate());

View Full Code Here

  /**
   * Toggle the selection of the checkbox if applicable.
   */
  private void toggleSelection() {
    syncExec(new VoidResult() {
      public void run() {
        if (hasStyle(widget, SWT.CHECK) | hasStyle(widget, SWT.RADIO))
          ((MenuItem) widget).setSelection(!((MenuItem) widget).getSelection());
      }
    });
View Full Code Here

   * @param treeItem the widget.
   * @throws WidgetNotFoundException if the widget is <code>null</code> or widget has been disposed.
   */
  public SWTBotTreeItem(final TreeItem treeItem) throws WidgetNotFoundException {
    super(treeItem);
    syncExec(new VoidResult() {
      public void run() {
        widget = treeItem.getParent();
        tree = widget;
      }
    });
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.