org.fest.swing.core
Class ComponentFoundCondition

java.lang.Object
  extended by org.fest.swing.timing.Condition
      extended by org.fest.swing.core.ComponentFoundCondition

public final class ComponentFoundCondition
extends Condition

Understands a condition that is satisfied if a GUI component that matches certain search criteria can be found.

Author:
Yvonne Wang, Alex Ruiz

Field Summary
 
Fields inherited from class org.fest.swing.timing.Condition
EMPTY_TEXT
 
Constructor Summary
ComponentFoundCondition(org.fest.assertions.Description description, ComponentFinder finder, ComponentMatcher matcher)
          Creates a new ComponentFoundCondition
ComponentFoundCondition(org.fest.assertions.Description description, ComponentFinder finder, ComponentMatcher matcher, Container root)
          Creates a new ComponentFoundCondition
ComponentFoundCondition(String description, ComponentFinder finder, ComponentMatcher matcher)
          Creates a new ComponentFoundCondition
ComponentFoundCondition(String description, ComponentFinder finder, ComponentMatcher matcher, Container root)
          Creates a new ComponentFoundCondition
 
Method Summary
protected  String descriptionAddendum()
          Returns the component hierarchy to be added to this condition's description in case of a component lookup failure.
 Collection<? extends Component> duplicatesFound()
          Returns all the components that satisfied the search criteria specified by this condition's ComponentMatcher.
 Component found()
          Returns the component found (if any.)
 boolean test()
          Returns true if a component that matches the search criteria in this condition's ComponentMatcher can be found.
 
Methods inherited from class org.fest.swing.timing.Condition
done, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComponentFoundCondition

public ComponentFoundCondition(String description,
                               ComponentFinder finder,
                               ComponentMatcher matcher)
Creates a new ComponentFoundCondition

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 new ComponentFoundCondition

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 new ComponentFoundCondition

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 new ComponentFoundCondition

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 Detail

test

public boolean test()
Returns true if a component that matches the search criteria in this condition's ComponentMatcher can be found. Otherwise, this method returns false.

Specified by:
test in class Condition
Returns:
true if a matching component can be found, false otherwise.

descriptionAddendum

protected String descriptionAddendum()
Returns the component hierarchy to be added to this condition's description in case of a component lookup failure.

Overrides:
descriptionAddendum in class Condition
Returns:
the component hierarchy to be added to this condition's description in case of a component lookup failure.

found

public Component found()
Returns the component found (if any.)

Returns:
the component found.

duplicatesFound

public Collection<? extends Component> 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.


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