Package org.fest.swing.exception

Examples of org.fest.swing.exception.ComponentLookupException


   */
  @RunsInEDT
  public @Nonnull JList dropDownList() {
    JList list = dropDownListFinder.findDropDownList();
    if (list == null) {
      throw new ComponentLookupException("Unable to find the pop-up list for the JComboBox");
    }
    return list;
  }
View Full Code Here


    condition = new ComponentFoundCondition("", finder, matcher, root);
  }

  @Test
  public void should_reset_matcher_when_match_not_found() {
    when(finder.find(root, matcher)).thenThrow(new ComponentLookupException("Thrown on purpose"));
    condition.test();
    verify(matcher).reset(false);
  }
View Full Code Here

  /**
   * @return the AWT {@code Component} hierarchy to be added to this condition's description in case of a lookup failure.
   */
  @Override
  protected @Nonnull String descriptionAddendum() {
    ComponentLookupException error = notFoundError.get();
    if (error == null) {
      return EMPTY_TEXT;
    }
    return concat(lineSeparator(), error.getMessage());
  }
View Full Code Here

  /**
   * @return all the AWT or Swing {@code Component}s that satisfied the search criteria specified by this condition's
   *         {@code ComponentMatcher}.
   */
  public Collection<? extends Component> duplicatesFound() {
    ComponentLookupException error = notFoundError.get();
    if (error == null) {
      return emptyList();
    }
    return error.found();
  }
View Full Code Here

      focusAndWaitForFocusGain(invoker);
    }
    click(invoker, location, RIGHT_BUTTON, 1);
    JPopupMenu popup = findActivePopupMenu();
    if (popup == null) {
      throw new ComponentLookupException(concat("Unable to show popup at ", location, " on ", inEdtFormat(invoker)));
    }
    long start = currentTimeMillis();
    while (!isWindowAncestorReadyForInput(popup) && currentTimeMillis() - start > POPUP_DELAY) {
      pause();
    }
View Full Code Here

    String message = concat("Unable to find component using matcher ", m, ".");
    if (includeHierarchyIfComponentNotFound()) {
      message = concat(message, lineSeparator(), lineSeparator(), "Component hierarchy:", lineSeparator(),
          formattedHierarchy(root(h)));
    }
    throw new ComponentLookupException(message);
  }
View Full Code Here

    message.append(String.format(format, m.toString()));
    appendComponents(message, found);
    if (!found.isEmpty()) {
      message.append(lineSeparator());
    }
    throw new ComponentLookupException(message.toString(), found);
  }
View Full Code Here

  private ComponentLookupException componentNotFound(ComponentHierarchy h, ComponentMatcher m) {
    String message = concat("Unable to find component using matcher ", m, ".");
    if (includeHierarchyIfComponentNotFound())
      message = concat(message,
          lineSeparator(), lineSeparator(), "Component hierarchy:", lineSeparator(), formattedHierarchy(root(h)));
    throw new ComponentLookupException(message);
  }
View Full Code Here

    message.append("Found more than one component using matcher ").append(m).append(".").append(lineSeparator())
           .append(lineSeparator())
           .append("Found:");
    appendComponents(message, found);
    if (!found.isEmpty()) message.append(lineSeparator());
    throw new ComponentLookupException(message.toString(), found);
  }
View Full Code Here

  public JPopupMenu showPopupMenu(Component invoker, Point location) {
    if (isFocusable(invoker)) focusAndWaitForFocusGain(invoker);
    click(invoker, location, RIGHT_BUTTON, 1);
    JPopupMenu popup = findActivePopupMenu();
    if (popup == null)
      throw new ComponentLookupException(concat("Unable to show popup at ", location, " on ", inEdtFormat(invoker)));
    long start = currentTimeMillis();
    while (!isWindowAncestorReadyForInput(popup) && currentTimeMillis() - start > POPUP_DELAY)
      pause();
    return popup;
  }
View Full Code Here

TOP

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

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.