Package net.sf.swtbot.finder.UIThreadRunnable

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


   *
   * @return all shells in the display.
   * @see Display#getShells()
   */
  protected Shell[] getShells() {
    return (Shell[]) UIThreadRunnable.syncExec(display, new ObjectResult() {
      public Object run() {
        return display.getShells();
      }
    });
  }
View Full Code Here


   *
   * @return the selection in the table
   */
  public TableCollection selection() {
    final int columnCount = columnCount();
    return (TableCollection) syncExec(new ObjectResult() {
      public Object run() {
        final TableCollection selection = new TableCollection();
        TableItem[] items = getControl().getSelection();
        for (int i = 0; i < items.length; i++) {
          TableItem item = items[i];
View Full Code Here

   * Gets the shells registered with the display.
   *
   * @return the shells
   */
  public Shell[] getShells() {
    return (Shell[]) UIThreadRunnable.syncExec(display, new ObjectResult() {
      public Object run() {
        return display.getShells();
      }
    });
  }
View Full Code Here

   * @return the active editor, if any
   * @throws WidgetNotFoundException if there is no active editor.
   * @since 1.1
   */
  public static SWTBotEclipseEditor activeEditor() throws WidgetNotFoundException {
    Object editor = UIThreadRunnable.syncExec(new ObjectResult() {
      public Object run() {
        try {
          IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
          return PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getReference(activeEditor);
        } catch (RuntimeException e) {
View Full Code Here

   * Return the Label's image or <code>null</code>.
   *
   * @return the image of the label or <code>null</code>.
   */
  public Image image() {
    return (Image) syncExec(new ObjectResult(){
      public Object run() {
        return getLabel().getImage();
      }
    });
  }
View Full Code Here

   *
   * @return the items in the receiver's list
   * @since 1.0
   */
  public String[] items() {
    return (String[]) syncExec(new ObjectResult() {
      public Object run() {
        return getCombo().getItems();
      }
    });
  }
View Full Code Here

   * @param display
   * @param index
   * @return a shell on the display
   */
  Widget getShell(final Display display, int index) {
    return ((Shell[]) UIThreadRunnable.syncExec(display, new ObjectResult() {
      public Object run() {
        return display.getShells();
      }
    }))[index];
  }
View Full Code Here

   * Returns an array of <code>String</code>s which are the items in the receiver's list.
   *
   * @return the items in the receiver's list
   */
  public String[] items() {
    return (String[]) syncExec(new ObjectResult() {
      public Object run() {
        return getCCombo().getItems();
      }
    });
  }
View Full Code Here

    final Method method = object.getClass().getMethod(methodName, new Class[0]);
    Widget widget = null;
    final Object result;
    if (object instanceof Widget) {
      widget = (Widget) object;
      result = UIThreadRunnable.syncExec(widget.getDisplay(), new ObjectResult() {
        public Object run() {
          try {
            return method.invoke(object, new Object[0]);
          } catch (Exception niceTry) {
          }
View Full Code Here

   * @return the selection in the tree
   */
  public TableCollection selection() {
    final int columnCount = columnCount();

    return (TableCollection) syncExec(new ObjectResult() {
      public Object run() {
        final TableCollection selection = new TableCollection();
        TreeItem[] items = getControl().getSelection();
        for (int i = 0; i < items.length; i++) {
          TreeItem item = items[i];
View Full Code Here

TOP

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

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.