Class JFileChooserFinder


public class JFileChooserFinder extends ComponentFinderTemplate<JFileChooser>
Understands a finder for JFileChoosers. Lookups are performed till a file chooser is found, or until the given time to perform the lookup is over. The default lookup time is 5 seconds.

This example illustrates finding a JFileChooser by name, using the default lookup time (5 seconds):

 JFileChooserFixture fileChooser = JFileChooserFinder.findFileChooser().using(robot);
 

Where robot is an instance of Robot.

This example shows how to find a JFileChooser by type using a lookup time of 10 seconds:

 JFileChooserFixture fileChooser = JFileChooserFinder.findFileChooser().withTimeout(10000).using(robot);
 
We can also specify the time unit:
 JFileChooserFixture fileChooser = JFileChooserFinder.findFileChooser().withTimeout(10, SECONDS).using(robot);
 

This examples shows how to find a JFileChooser using a GenericTypeMatcher:

 GenericTypeMatcher<JFileChooser> matcher = new GenericTypeMatcher<JFileChooser>() {
   protected boolean isMatching(JFileChooser fileChooser) {
     return fileChooser.getCurrentDirectory().getAbsolutePath().equals("c:\\temp");
   }
 };
 JFileChooserFixture fileChooser = JFileChooserFinder.findFileChooser(matcher).using(robot);