Package org.fest.swing.core
Class ComponentFoundCondition
java.lang.Object
org.fest.swing.timing.Condition
org.fest.swing.core.ComponentFoundCondition
Understands a condition that is satisfied if a GUI component that matches certain search criteria can be found.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ComponentFinderprivate Componentprivate final ComponentMatcherprivate final AtomicReference<ComponentLookupException>private final ContainerFields inherited from class org.fest.swing.timing.Condition
EMPTY_TEXT -
Constructor Summary
ConstructorsConstructorDescriptionComponentFoundCondition(String description, ComponentFinder finder, ComponentMatcher matcher) Creates a newComponentFoundConditionComponentFoundCondition(String description, ComponentFinder finder, ComponentMatcher matcher, Container root) Creates a newComponentFoundConditionComponentFoundCondition(org.fest.assertions.Description description, ComponentFinder finder, ComponentMatcher matcher) Creates a newComponentFoundConditionComponentFoundCondition(org.fest.assertions.Description description, ComponentFinder finder, ComponentMatcher matcher, Container root) Creates a newComponentFoundCondition -
Method Summary
Modifier and TypeMethodDescriptionprotected StringReturns the component hierarchy to be added to this condition's description in case of a component lookup failure.Collection<? extends Component>Returns all the components that satisfied the search criteria specified by this condition's.ComponentMatcherfound()Returns the component found (if any.)private voidresetMatcher(boolean matchFound) booleantest()Returnstrueif a component that matches the search criteria in this condition'scan be found.ComponentMatcher
-
Field Details
-
finder
-
matcher
-
root
-
found
-
notFoundError
-
-
Constructor Details
-
ComponentFoundCondition
public ComponentFoundCondition(String description, ComponentFinder finder, ComponentMatcher matcher) Creates a newComponentFoundCondition- Parameters:
description- the description of this condition.finder- performs the component search.matcher- specifies the condition that the component we are looking for needs to match.
-
ComponentFoundCondition
public ComponentFoundCondition(String description, ComponentFinder finder, ComponentMatcher matcher, Container root) Creates a newComponentFoundCondition- Parameters:
description- the description of this condition.finder- performs the component search.matcher- specifies the condition that the component we are looking for needs to match.root- the root used as the starting point of the search.
-
ComponentFoundCondition
public ComponentFoundCondition(org.fest.assertions.Description description, ComponentFinder finder, ComponentMatcher matcher) Creates a newComponentFoundCondition- Parameters:
description- the description of this condition.finder- performs the component search.matcher- specifies the condition that the component we are looking for needs to match.
-
ComponentFoundCondition
public ComponentFoundCondition(org.fest.assertions.Description description, ComponentFinder finder, ComponentMatcher matcher, Container root) Creates a newComponentFoundCondition- Parameters:
description- the description of this condition.finder- performs the component search.matcher- specifies the condition that the component we are looking for needs to match.root- the root used as the starting point of the search.
-
-
Method Details
-
test
public boolean test()Returnstrueif a component that matches the search criteria in this condition'scan be found. Otherwise, this method returnsComponentMatcherfalse. -
resetMatcher
private void resetMatcher(boolean matchFound) -
descriptionAddendum
Returns the component hierarchy to be added to this condition's description in case of a component lookup failure.- Overrides:
descriptionAddendumin classCondition- Returns:
- the component hierarchy to be added to this condition's description in case of a component lookup failure.
-
found
Returns the component found (if any.)- Returns:
- the component found.
-
duplicatesFound
Returns all the components that satisfied the search criteria specified by this condition's.ComponentMatcher- Returns:
- all the components that satisfied the search criteria specified by this condition's
ComponentMatcher.
-