T
- the type of component this finder can search.public abstract class ComponentFinderTemplate<T extends Component> extends Object
Component
finders.Modifier | Constructor and Description |
---|---|
protected |
ComponentFinderTemplate(Class<? extends T> componentType)
Creates a new
ComponentFinderTemplate . |
protected |
ComponentFinderTemplate(GenericTypeMatcher<? extends T> matcher)
Creates a new
ComponentFinderTemplate . |
protected |
ComponentFinderTemplate(String componentName,
Class<? extends T> componentType)
Creates a new
ComponentFinderTemplate . |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
cast(Component c)
Casts the given
Component to the type supported by this finder. |
protected T |
findComponentWith(Robot robot)
Finds the component using either by name or type.
|
abstract ComponentFixture<T> |
using(Robot robot)
Finds a component by name or type using the given robot.
|
protected ComponentFinderTemplate<T> |
withTimeout(long newTimeout)
Sets the timeout for this finder.
|
protected ComponentFinderTemplate<T> |
withTimeout(long newTimeout,
TimeUnit unit)
Sets the timeout for this finder.
|
protected ComponentFinderTemplate(String componentName, Class<? extends T> componentType)
ComponentFinderTemplate
.componentName
- the name of the Component
to find.componentType
- the type of the Component
to find.protected ComponentFinderTemplate(GenericTypeMatcher<? extends T> matcher)
ComponentFinderTemplate
.matcher
- specifies the search criteria to use when looking up a Component
.protected ComponentFinderTemplate(Class<? extends T> componentType)
ComponentFinderTemplate
.componentType
- the type of the Component
to find.protected ComponentFinderTemplate<T> withTimeout(long newTimeout, TimeUnit unit)
Component
to find should be found within the given time period.newTimeout
- the period of time the search should be performed.unit
- the time unit for timeout
.NullPointerException
- if the time unit is null
.IllegalArgumentException
- if the timeout is a negative number.protected ComponentFinderTemplate<T> withTimeout(long newTimeout)
Component
to find should be found within the given time period.newTimeout
- the number of milliseconds before stopping the search.IllegalArgumentException
- if the timeout is a negative number.public abstract ComponentFixture<T> using(Robot robot)
robot
- contains the underlying finding to delegate the search to.WaitTimedOutError
- if a component with the given name or of the given type could not be found.protected final T findComponentWith(Robot robot)
robot
- contains the underlying finding to delegate the search to.WaitTimedOutError
- if a component with the given name or of the given type could not be found.Copyright © 2007-2012 FEST (Fixtures for Easy Software Testing). All Rights Reserved.