/** * Finds a {@code JOptionPane} by name or type. * * @param robot contains the underlying finding to delegate the search to. * @return a {@code JOptionPaneFixture} managing the found {@code JOptionPane}. * @throws org.assertj.swing.exception.WaitTimedOutError if a {@code JOptionPane} could not be found. */ @Override @Nonnull public JOptionPaneFixture using(@Nonnull Robot robot) { return new JOptionPaneFixture(robot, findComponentWith(robot)); }
@RunsInEDT @Override @Nonnull public 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)); }