Package org.fest.swing.core

Examples of org.fest.swing.core.ComponentFoundCondition


   * @throws ActionFailedException if an editor for the given cell cannot be found or cannot be activated.
   */
  @RunsInEDT
  protected final @Nullable <T extends Component> T waitForEditorActivation(@Nonnull ComponentMatcher matcher,
      @Nonnull JTable table, int row, int column, @Nonnull Class<T> supportedType) {
    ComponentFoundCondition condition = new ComponentFoundCondition("", robot.finder(), matcher, table);
    try {
      pause(condition, EDITOR_LOOKUP_TIMEOUT);
    } catch (WaitTimedOutError e) {
      throw cannotFindOrActivateEditor(row, column);
    }
    return supportedType.cast(condition.found());
  }
View Full Code Here


    return findDialog(matcher, timeout);
  }

  private @Nonnull DialogFixture findDialog(@Nonnull ComponentMatcher matcher, @Nonnull Timeout timeout) {
    String description = "dialog to be found using matcher " + matcher;
    ComponentFoundCondition condition = new ComponentFoundCondition(description, robot().finder(), matcher);
    pause(condition, timeout);
    Dialog dialog = (Dialog) condition.found();
    return new DialogFixture(robot(), checkNotNull(dialog));
  }
View Full Code Here

    return findFileChooser(matcher, timeout);
  }

  private @Nonnull JFileChooserFixture findFileChooser(@Nonnull ComponentMatcher matcher, @Nonnull Timeout timeout) {
    String description = "file chooser to be found using matcher " + matcher;
    ComponentFoundCondition condition = new ComponentFoundCondition(description, robot().finder(), matcher);
    pause(condition, timeout);
    JFileChooser fileChooser = (JFileChooser) condition.found();
    return new JFileChooserFixture(robot(), checkNotNull(fileChooser));
  }
View Full Code Here

  @RunsInEDT
  @Override
  public @Nonnull JOptionPaneFixture optionPane(@Nonnull Timeout timeout) {
    TypeMatcher matcher = new TypeMatcher(JOptionPane.class, requireShowing());
    String description = "option pane to be found using matcher " + matcher;
    ComponentFoundCondition condition = new ComponentFoundCondition(description, robot().finder(), matcher);
    pause(condition, timeout);
    JOptionPane optionPane = (JOptionPane) condition.found();
    return new JOptionPaneFixture(robot(), checkNotNull(optionPane));
  }
View Full Code Here

   * @param robot contains the underlying finding to delegate the search to.
   * @return the found component.
   * @throws WaitTimedOutError if a component with the given name or of the given type could not be found.
   */
  protected final @Nonnull T findComponentWith(@Nonnull Robot robot) {
    ComponentFoundCondition condition = new ComponentFoundCondition(searchDescription, robot.finder(), matcher);
    pause(condition, timeout);
    return checkNotNull(cast(condition.found()));
  }
View Full Code Here

    return findDialog(matcher, timeout);
  }

  private DialogFixture findDialog(ComponentMatcher matcher, Timeout timeout) {
    String description = "dialog to be found using matcher " + matcher;
    ComponentFoundCondition condition = new ComponentFoundCondition(description, robot.finder(), matcher);
    pause(condition, timeout);
    return new DialogFixture(robot, (Dialog)condition.found());
  }
View Full Code Here

    return findFileChooser(matcher, timeout);
  }

  private JFileChooserFixture findFileChooser(ComponentMatcher matcher, Timeout timeout) {
    String description = "file chooser to be found using matcher " + matcher;
    ComponentFoundCondition condition = new ComponentFoundCondition(description, robot.finder(), matcher);
    pause(condition, timeout);
    return new JFileChooserFixture(robot, (JFileChooser)condition.found());
  }
View Full Code Here

  /** {@inheritDoc} */
  public JOptionPaneFixture optionPane(Timeout timeout) {
    TypeMatcher matcher = new TypeMatcher(JOptionPane.class, requireShowing());
    String description = "option pane to be found using matcher " + matcher;
    ComponentFoundCondition condition = new ComponentFoundCondition(description, robot.finder(), matcher);
    pause(condition, timeout);
    return new JOptionPaneFixture(robot, (JOptionPane)condition.found());
  }
View Full Code Here

     * assertion error is thrown.
     *
     * @param dialogClass dialog class
     */
    protected void assertComponentDisplayed(Class<? extends Component> componentClass) {
        Pause.pause(new ComponentFoundCondition("component to be displayed",
                BasicComponentFinder.finderWithCurrentAwtHierarchy(),
                new TypeMatcher(componentClass, true)),
                DISPLAY_TIMEOUT);
    }
View Full Code Here

TOP

Related Classes of org.fest.swing.core.ComponentFoundCondition

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.