Package net.sf.swtbot.finder.UIThreadRunnable

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


   */
  public void click() throws WidgetNotFoundException {
    if (commandID != null) {
      menuClickResult = null;

      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$
View Full Code Here


  /**
   * Close the view.
   */
  public void close() {
    syncExec(new VoidResult() {
      public void run() {
        IViewReference viewReference = (IViewReference) view;
        viewReference.getPage().hideView(viewReference);
      }
    });
View Full Code Here

   * Shows the part if it is visible.
   *
   * @since 1.0
   */
  public void show() {
    syncExec(new VoidResult() {
      public void run() {
        try {
          view.getPage().activate(view.getPart(true));
          view.getPage().showView(view.getId());
        } catch (PartInitException e) {
View Full Code Here

   * @param rowIndex the index of the row to select.
   * @return this same instance.
   */
  public SWTBotTree 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(getControl().getItem(rowIndex));
      }
View Full Code Here

   * @param item the item to select
   * @return this same instance.
   */
  public SWTBotTree select(final String item) {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        TreeItem[] treeItems = getControl().getItems();
        for (int i = 0; i < treeItems.length; i++) {
          TreeItem treeItem = treeItems[i];
          if (treeItem.getText().equals(item))
View Full Code Here

   * @param items the items to select.
   * @return this same instance.
   */
  public SWTBotTree select(final String[] items) {
    checkEnabled();
    asyncExec(new VoidResult() {
      public void run() {
        TreeItem[] treeItems = getControl().getItems();
        List selection = new ArrayList();
        for (int i = 0; i < treeItems.length; i++) {
          TreeItem treeItem = treeItems[i];
View Full Code Here

   *
   * @return this same instance.
   */
  public SWTBotTree 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 indices to select.
   * @return this same instance.
   */
  public SWTBotTree 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

        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() {
        getCombo().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() {
        getCombo().select(index);
      }
    });
  }
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.