Examples of ObjectResult


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

   * Gets the date of this widget.
   *
   * @return the date/time set into the widget.
   */
  public Date getDate() {
    return (Date) syncExec(new ObjectResult() {
      public Object run() {
        int year = getControl().getYear();
        int month = getControl().getMonth();
        int day = getControl().getDay();

View Full Code Here

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

   * @param nodeText the text on the node.
   * @return the node with the specified text <code>null</code> if not match exists.
   * @since 1.2
   */
  public SWTBotTreeItem getNode(final String nodeText) {
    return (SWTBotTreeItem) syncExec(new ObjectResult() {
      public Object run() {
        try {
          TreeItem[] items = getTreeItem().getItems();
          for (int i = 0; i < items.length; i++) {
            TreeItem treeItem = items[i];
View Full Code Here

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

   * @return the current node.
   * @since 1.2
   */
  public SWTBotTreeItem click() {
    checkEnabled();
    Rectangle cellBounds = (Rectangle) syncExec(new ObjectResult() {
      public Object run() {
        return treeItem.getBounds();
      }
    });
    clickXY(cellBounds.x + (cellBounds.width / 2), cellBounds.y + (cellBounds.height / 2));
View Full Code Here

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

   * Gets the current position of the cursor.
   *
   * @return the position of the cursor in the styled text.
   */
  public Position cursorPosition() {
    return (Position) syncExec(new ObjectResult() {
      public Object run() {
        getControl().setFocus();
        int offset = getControl().getSelectionRange().x;
        int lineNumber = getControl().getContent().getLineAtOffset(offset);
        int offsetAtLine = getControl().getContent().getOffsetAtLine(lineNumber);
View Full Code Here

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

   * @param line the line number.
   * @param column the column number.
   * @return the {@link StyleRange} at the specified location
   */
  public StyleRange getStyle(final int line, final int column) {
    return (StyleRange) syncExec(new ObjectResult() {
      public Object run() {
        return getControl().getStyleRangeAtOffset(offset(line, column));
      }
    });
  }
View Full Code Here

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

   * @param length the length.
   * @return the styles in the specified range.
   * @see StyledText#getStyleRanges(int, int)
   */
  public StyleRange[] getStyles(final int line, final int column, final int length) {
    return (StyleRange[]) syncExec(new ObjectResult() {
      public Object run() {
        return getControl().getStyleRanges(offset(line, column), length);
      }

    });
View Full Code Here

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

   * @param line the line number.
   * @return the bullet on the given line.
   * @see StyledText#getLineBullet(int)
   */
  public Bullet getBulletOnLine(final int line) {
    return (Bullet) syncExec(new ObjectResult() {
      public Object run() {
        return getControl().getLineBullet(line);
      }
    });
  }
View Full Code Here

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

  /**
   * @return the list of all expandBar items in the expandBar, or an empty list if there are none.
   */
  public SWTBotExpandItem[] getAllItems() {
    return (SWTBotExpandItem[]) syncExec(new ObjectResult() {
      public Object run() {
        ExpandItem[] items = getControl().getItems();
        SWTBotExpandItem[] result = new SWTBotExpandItem[items.length];
        for (int i = 0; i < items.length; i++)
          try {
View Full Code Here

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

    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

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
TOP
Copyright © 2018 www.massapi.com. 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.