org.fest.swing.finder
Class DialogFinder

java.lang.Object
  extended by org.fest.swing.finder.ComponentFinderTemplate<T>
      extended by org.fest.swing.finder.WindowFinderTemplate<Dialog>
          extended by org.fest.swing.finder.DialogFinder

public class DialogFinder
extends WindowFinderTemplate<Dialog>

Understands a finder for Dialogs. This class cannot be used directly, please see WindowFinder.

Author:
Yvonne Wang, Alex Ruiz

Constructor Summary
protected DialogFinder(Class<? extends Dialog> dialogType)
          Creates a new DialogFinder.
protected DialogFinder(GenericTypeMatcher<? extends Dialog> matcher)
          Creates a new DialogFinder.
protected DialogFinder(String dialogName)
          Creates a new DialogFinder.
 
Method Summary
protected  Dialog cast(Component c)
          Casts the given Component to Dialog.
 DialogFixture using(Robot robot)
          Finds a Dialog by name or type.
 DialogFinder withTimeout(long timeout)
          Sets the timeout for this finder.
 DialogFinder withTimeout(long timeout, TimeUnit unit)
          Sets the timeout for this finder.
 
Methods inherited from class org.fest.swing.finder.ComponentFinderTemplate
findComponentWith
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DialogFinder

protected DialogFinder(String dialogName)
Creates a new DialogFinder.

Parameters:
dialogName - the name of the Dialog to look for.

DialogFinder

protected DialogFinder(GenericTypeMatcher<? extends Dialog> matcher)
Creates a new DialogFinder.

Parameters:
matcher - specifies the search criteria to use when looking up a Dialog.

DialogFinder

protected DialogFinder(Class<? extends Dialog> dialogType)
Creates a new DialogFinder.

Parameters:
dialogType - the type of Dialog to look for.
Method Detail

withTimeout

public DialogFinder withTimeout(long timeout)
Sets the timeout for this finder. The window to search should be found within the given time period.

Overrides:
withTimeout in class WindowFinderTemplate<Dialog>
Parameters:
timeout - the number of milliseconds before stopping the search.
Returns:
this finder.

withTimeout

public DialogFinder withTimeout(long timeout,
                                TimeUnit unit)
Sets the timeout for this finder. The window to search should be found within the given time period.

Overrides:
withTimeout in class WindowFinderTemplate<Dialog>
Parameters:
timeout - the period of time the search should be performed.
unit - the time unit for timeout.
Returns:
this finder.

using

public DialogFixture using(Robot robot)
Finds a Dialog by name or type.

Specified by:
using in class WindowFinderTemplate<Dialog>
Parameters:
robot - contains the underlying finding to delegate the search to.
Returns:
a DialogFixture managing the found Dialog.
Throws:
WaitTimedOutError - if a Dialog could not be found.

cast

protected Dialog cast(Component c)
Casts the given Component to Dialog.

Specified by:
cast in class ComponentFinderTemplate<Dialog>
Parameters:
c - the given Component.
Returns:
the given Component, casted to Dialog.


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.