Package net.sf.swtbot.finder.UIThreadRunnable

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


   * @param rowIndex the zero-based index of the row to be selected.
   */
  public void select(final int rowIndex) {
    checkEnabled();
    assertIsLegalRowIndex(rowIndex);
    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


  /**
   * 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

   */
  public void select(final int[] indices) {
    checkEnabled();
    Arrays.sort(indices);
    assertIsLegalRowIndex(indices[indices.length - 1]);
    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

   */
  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

   *
   * @param quickFixTable the table containing the quickfix
   * @param quickFixIndex the index of the quickfix.
   */
  protected void applyQuickFix(final SWTBotTable quickFixTable, final int quickFixIndex) {
    asyncExec(new VoidResult() {
      public void run() {
        if (log.isDebugEnabled())
          log.debug("Selecting row [" + quickFixIndex + "] " + getControl().getItem(quickFixIndex).getText() + " in " + widget);
        getControl().setSelection(quickFixIndex);
        Event event = new Event();
View Full Code Here

    save();
    close();
  }

  public void close() {
    syncExec(new VoidResult() {
      public void run() {
        IEditorReference editorReference = (IEditorReference) view;
        editorReference.getPage().closeEditor(editorReference.getEditor(false), false);
      }
    });
View Full Code Here

  /**
   * Save the editor.
   */
  public void save() {
    syncExec(new VoidResult() {
      public void run() {
        ((IEditorReference) view).getEditor(false).doSave(null);
      }
    });
  }
View Full Code Here

  /**
   * Shows the editor if it is visible.
   */
  public void show() {
    syncExec(new VoidResult() {
      public void run() {
        IEditorReference editorReference = (IEditorReference) view;
        IEditorPart editor = editorReference.getEditor(true);
        view.getPage().activate(editor);
      }
View Full Code Here

  public void click() throws WidgetNotFoundException {
    if (commandID != null) {
      menuClickResult = null;
      final IHandlerService handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class);

      UIThreadRunnable.asyncExec(new VoidResult() {
        public void run() {
          try {
            menuClickResult = handlerService.executeCommand(commandID, null);
          } catch (Exception e) {
            throw new RuntimeException("Failed to execute the command - " + commandID, e); //$NON-NLS-1$
          }
        }
      });
    } else if (action != null)
      UIThreadRunnable.asyncExec(new VoidResult() {
        public void run() {
          action.run();
        }
      });
    else
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.