Class PropChooser
java.lang.Object
org.netbeans.jemmy.util.PropChooser
- All Implemented Interfaces:
ComponentChooser, Outputable
- Direct Known Subclasses:
StringPropChooser
Implementation of org.netbeans.jemmy.ComponentChooser interface.
Class can be used to find component by its field/methods values.
Example:
Example:
String[] methods = {"getClientProperty"};
Object[][] params = {{"classname"}};
Class[][] classes = {{Object.class}};
Object[] results = {"javax.swing.JCheckBox"};
JCheckBox box = JCheckBoxOperator.findJCheckBox(frm0, new PropChooser(methods, params, classes, results));
Or:
String[] methods = {"getText"};
Object[] results = {"Open"};
JButtonOperator box = new JButtonOperator(containerOperator, new PropChooser(fields, results));
- Author:
- Alexandre Iline (alexandre.iline@sun.com)
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPropChooser(String[] propNames, Object[] results) Constructs a PropChooser object for checking of methods with no parameters.PropChooser(String[] propNames, Object[][] params, Class[][] classes, Object[] results) Constructs a PropChooser object. -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckComponent(Component comp) Check if the component argument meets the search criteria.protected booleancheckProperty(Object value, Object etalon) Method to check one method result with an etalon.Returns searched component description.Returns print output streams or writers.voidDefines print output streams or writers.
-
Field Details
-
propNames
Names of methods to check. -
params
Methods parameters. -
classes
Classes of parameters. -
results
Expected results of methods.
-
-
Constructor Details
-
PropChooser
Constructs a PropChooser object.- Parameters:
propNames- Names of methods/fieldsparams- Parameters values for methods.
params[0] is an array of parameters for propNames[0] methods.
If propNames[0] is a field, params[0] is ignored.classes- Parameters classes.results- Objects to compare method/field values to.
A value of propNames[0] method/field should be equal to results[0] object.
-
PropChooser
-
-
Method Details
-
setOutput
Description copied from interface:OutputableDefines print output streams or writers.- Specified by:
setOutputin interfaceOutputable- Parameters:
output- Identify the streams or writers used for print output.- See Also:
-
getOutput
Description copied from interface:OutputableReturns print output streams or writers.- Specified by:
getOutputin interfaceOutputable- Returns:
- an object that contains references to objects for printing to output and err streams.
- See Also:
-
checkComponent
Description copied from interface:ComponentChooserCheck if the component argument meets the search criteria.- Specified by:
checkComponentin interfaceComponentChooser- Parameters:
comp- Component to check.- Returns:
truewhen the component conforms to the search criteria;falseotherwise.
-
getDescription
Description copied from interface:ComponentChooserReturns searched component description.- Specified by:
getDescriptionin interfaceComponentChooser- Returns:
- a String representing the description value
-
checkProperty
-