Package org.fest.swing.finder
Class WindowFinderTemplate<T extends Window>
java.lang.Object
org.fest.swing.finder.ComponentFinderTemplate<T>
org.fest.swing.finder.WindowFinderTemplate<T>
- Type Parameters:
T- the type of window this finder can search.
- Direct Known Subclasses:
DialogFinder,FrameFinder
Understands a template for
Window finders.-
Field Summary
Fields inherited from class org.fest.swing.finder.ComponentFinderTemplate
TIMEOUT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWindowFinderTemplate(Class<? extends T> windowType) Creates a newWindowFinderTemplate.protectedWindowFinderTemplate(String windowName, Class<? extends T> windowType) Creates a newWindowFinderTemplate.protectedWindowFinderTemplate(GenericTypeMatcher<? extends T> matcher) Creates a newWindowFinderTemplate. -
Method Summary
Modifier and TypeMethodDescriptionabstract WindowFixture<T>Finds a window by name or type using the given robot.protected WindowFinderTemplate<T>withTimeout(long timeout) Sets the timeout for this finder.protected WindowFinderTemplate<T>withTimeout(long timeout, TimeUnit unit) Sets the timeout for this finder.Methods inherited from class org.fest.swing.finder.ComponentFinderTemplate
cast, findComponentWith
-
Constructor Details
-
WindowFinderTemplate
Creates a newWindowFinderTemplate.- Parameters:
windowName- the name of theWindowto find.windowType- the type of theWindowto find.
-
WindowFinderTemplate
Creates a newWindowFinderTemplate.- Parameters:
matcher- specifies the search criteria to use when looking up aWindow.
-
WindowFinderTemplate
Creates a newWindowFinderTemplate.- Parameters:
windowType- the type of theWindowto find.
-
-
Method Details
-
withTimeout
Sets the timeout for this finder. Theto find should be found within the given time period.Window- Overrides:
withTimeoutin classComponentFinderTemplate<T extends Window>- Parameters:
timeout- the number of milliseconds before stopping the search.- Returns:
- this finder.
- Throws:
IllegalArgumentException- if the timeout is a negative number.
-
withTimeout
Sets the timeout for this finder. Theto find should be found within the given time period.Window- Overrides:
withTimeoutin classComponentFinderTemplate<T extends Window>- Parameters:
timeout- the period of time the search should be performed.unit- the time unit fortimeout.- Returns:
- this finder.
- Throws:
NullPointerException- if the time unit isnull.IllegalArgumentException- if the timeout is a negative number.
-
using
Finds a window by name or type using the given robot.- Specified by:
usingin classComponentFinderTemplate<T extends Window>- Parameters:
robot- contains the underlying finding to delegate the search to.- Returns:
- a fixture capable of managing the found window.
- Throws:
WaitTimedOutError- if a window with the given name or of the given type could not be found.
-