public class ComponentSearcher extends java.lang.Object implements Outputable
java.awt.Container in the display containment hierarchy.
Uses a ComponentChooser interface implementation to find a
component.ComponentChooser| Constructor and Description |
|---|
ComponentSearcher(java.awt.Container c)
Contructor.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Component |
findComponent(ComponentChooser chooser)
Searches for a component.
|
java.awt.Component |
findComponent(ComponentChooser chooser,
int index)
Searches for a component.
|
java.awt.Component[] |
findComponents(ComponentChooser chooser)
Searches for all components.
|
TestOut |
getOutput()
Returns print output streams or writers.
|
static ComponentChooser |
getTrueChooser(java.lang.String description)
Creates
ComponentChooser implementation
whose checkComponent(Component)
method returns true for any component. |
void |
setOutput(TestOut output)
Defines print output streams or writers.
|
public ComponentSearcher(java.awt.Container c)
c - Container to find components in.public static ComponentChooser getTrueChooser(java.lang.String description)
ComponentChooser implementation
whose checkComponent(Component)
method returns true for any component.description - Component description.public void setOutput(TestOut output)
setOutput in interface Outputableoutput - ?out? Identify the streams or writers used for print output.TestOut,
Outputable,
getOutput()public TestOut getOutput()
getOutput in interface OutputableTestOut,
Outputable,
setOutput(org.netbeans.jemmy.TestOut)public java.awt.Component findComponent(ComponentChooser chooser, int index)
ComponentChooser's container.chooser - ComponentChooser instance, defining and applying the
search criteria.index - Ordinal component index. Indices start at 0.index'th component from among those components
for which the chooser's checkComponent(Component) method
returns true.
A null reference is returned if there are fewer than
index-1 components meeting the search
criteria exist in the component hierarchy rooted in this
ComponentChooser's container.public java.awt.Component findComponent(ComponentChooser chooser)
ComponentChooser's container.chooser - ComponentChooser instance, defining and applying the
search criteria.checkComponent(Component) method returns true.
A null reference is returned if no component meeting the search
criteria exist in the component hierarchy rooted in this
ComponentChooser's container.public java.awt.Component[] findComponents(ComponentChooser chooser)
ComponentChooser's container.chooser - ComponentChooser instance, defining and applying the
search criteria.checkComponent(Component) method returns true.
An empty array is returned if no component meeting the search
criteria exists in the component hierarchy rooted in this
ComponentChooser's container.