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