Package org.fest.swing.exception

Examples of org.fest.swing.exception.LocationUnavailableException


    }
    return new TreePath(newPathValues.toArray());
  }

  private @Nonnull LocationUnavailableException pathNotFound(@Nonnull String path) {
    throw new LocationUnavailableException(String.format("Unable to find path %s", quote(path)));
  }
View Full Code Here


  }

  private @Nonnull LocationUnavailableException multipleMatchingNodes(@Nonnull String matchingText,
      @Nullable Object parentText) {
    String msg = String.format("There is more than one node with value '%s' under", matchingText, quote(parentText));
    throw new LocationUnavailableException(msg);
  }
View Full Code Here

  private void selectItem(@Nonnull JComboBox comboBox, @Nonnull TextMatcher matcher) {
    int index = matchingItemIndex(comboBox, matcher, cellReader());
    if (index < 0) {
      String format = "Unable to find item matching %s among the JComboBox contents: ";
      String msg = String.format(format, matcher.description(), format(contentsOf(comboBox)));
      throw new LocationUnavailableException(msg);
    }
    selectItem(comboBox, index);
  }
View Full Code Here

  private void waitForChildrenToShowUp(@Nonnull JTree tree, @Nonnull TreePath path) {
    int timeout = robot.settings().timeoutToBeVisible();
    try {
      pause(untilChildrenShowUp(tree, path), timeout);
    } catch (WaitTimedOutError e) {
      throw new LocationUnavailableException(e.getMessage());
    }
  }
View Full Code Here

    if (isValidIndex(tableHeader, index)) {
      return Pair.of(index, point(tableHeader, index));
    }
    String format = "Unable to find column with name matching %s %s";
    String msg = String.format(format, matcher.description(), matcher.formattedValues());
    throw new LocationUnavailableException(msg);
  }
View Full Code Here

  private @Nonnull LocationUnavailableException failMatchingNotFound(@Nonnull JList list,
      @Nonnull TextMatcher matcher) {
    String format = "Unable to find item matching the %s %s among the JList contents %s";
    String msg = String.format(format, matcher.description(), matcher.formattedValues(),
        format(contents(list, cellReader())));
    return new LocationUnavailableException(msg);
  }
View Full Code Here

    showWindow();
    selectFirstTab();
    JTabbedPaneLocation location = mock(JTabbedPaneLocation.class);
    int index = 1;
    driver = new JTabbedPaneDriver(robot, location);
    when(location.pointAt(tabbedPane, index)).thenThrow(new LocationUnavailableException("Thrown on purpose"));
    driver.selectTab(tabbedPane, index);
    assertThatSelectedTabIndexIs(index);
    verify(location).checkIndexInBounds(tabbedPane, index); // everything goes fine.
  }
View Full Code Here

  public @Nonnull Pair<Rectangle, Point> rowBoundsAndCoordinates(@Nonnull JTree tree, int row) {
    Rectangle rowBounds = tree.getRowBounds(checkRowInBounds(tree, row));
    if (rowBounds != null) {
      return Pair.of(rowBounds, pointAt(rowBounds));
    }
    throw new LocationUnavailableException(String.format("The tree row <%d> is not visible", row));
  }
View Full Code Here

  public @Nonnull TreePath pathFor(@Nonnull JTree tree, int row) {
    TreePath path = tree.getPathForRow(checkRowInBounds(tree, row));
    if (path != null) {
      return path;
    }
    throw new LocationUnavailableException(String.format("Unable to find tree path for row <%d>", row));
  }
View Full Code Here

  public @Nonnull Pair<Rectangle, Point> pathBoundsAndCoordinates(@Nonnull JTree tree, @Nonnull TreePath path) {
    Rectangle pathBounds = tree.getPathBounds(path);
    if (pathBounds != null) {
      return Pair.of(pathBounds, pointAt(pathBounds));
    }
    throw new LocationUnavailableException(String.format("The tree path %s is not visible", format(path.getPath())));
  }
View Full Code Here

TOP

Related Classes of org.fest.swing.exception.LocationUnavailableException

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.