With the suntest.javastar.lib.JSComponent class, you can send events to components, or find related subcomponents--such as those it contains, associated dialogs, and so on. While you can't instantiate a JSComponent
, many of the methods of the JS
class return JSComponents
. Also, if you have a component you want to wrap into a JSComponent
, you can use
wrap(Component).
This section describes JSComponent
by:
public interface JSComponent
extends Object
This section provides two ways to view methods. You can use:
If you are viewing this documentation on-line, you can click on any method name to jump to the full description, syntax, and parameter specification.
Method | Category | Description |
---|---|---|
absolute(int)
|
Scrolling methods | Scrolls to the position you specify. |
action()
|
Send event methods |
Sends an ACTION event to a Button or Textfield.
|
action(String)
|
Send event methods | Sends an action event to Button, Choice, List, or TextField. |
ageDifferentiation(int, int)
|
Find methods | Disambiguates based on relative construction time (approximately). |
button(String)
|
Find methods | Finds contained buttons which have an exact label match. |
buttonPress()
|
Send event methods |
Sends MOUSE_PRESSED , MOUSE_RELEASED , MOUSE_CLICKED , and the ActionEvent. Valid only for Buttons.
|
buttonRE(String)
|
Find methods | Finds contained buttons which have labels matching this regular expression. |
buttonRX(String)
|
Deprecated methods | Finds contained buttons which have labels matching this regular expression. Uses old syntax for regular expressions. |
center(String, String)
|
Find methods | Returns the Center member that meets the specified type and label requirements. |
child(int, String, String)
|
Find methods | Returns a child component that meets the specified type and label requirements. |
choosefile(String, String)
|
Send event methods | FileDialog simulation event. |
deiconify()
|
Send event methods |
Sends a WINDOW_DEICONIFY event.
|
deselect()
|
Send event methods |
Sends a DESELECTED ItemEvent to a Checkbox.
|
deselect(int)
|
Send event methods | Deselects the indexed entry of a List. |
deselect(String)
|
Send event methods | Deselects an item in a List. |
deselect(int, String)
|
Send event methods | Deselects the indexed entry of a List. Requires that the text of the item match. |
destroy()
|
Send event methods |
Sends a WINDOW_CLOSING event.
|
dialog(String)
|
Find methods | Returns dialogs of this Frame whose title matches title. |
dialog(String, String)
|
Find methods | Returns dialogs of this Frame that meet specified type and title requirements. |
dialogRE(String)
|
Find methods | Returns dialogs that have title matching regular expression. |
dialogRE(String, String)
|
Find methods | Returns dialogs of this Frame of the specified type that have title matching regular expression. |
dialogRX(String)
|
Deprecated methods | Returns dialogs that have a title matching this regular expression. |
dialogRX(String, String)
|
Deprecated methods | Returns dialogs that meet specified type and title matching regular expression. |
east(String, String)
|
Find methods | Returns the East member, requiring that it meet specified type and label requirements. |
fkey(int, int)
|
Send event methods |
Sends a KEY_ACTION KeyEvent.
|
fkeyUp(int, int)
|
Send event methods |
Sends a KEY_ACTION_RELEASE KeyEvent.
|
getAll()
|
Query methods |
Returns all Components pointed to by this JSComponent .
|
getAllValid()
|
Query methods |
Returns all Components pointed to by this JSComponent which are capable of receiving events.
|
getAnyField(String)
|
Convenience methods | Returns the value of the data member name on the contained Component. |
getAnyMethod(String)
|
Convenience methods |
Returns the value of the method name() on the contained Component.
|
getUnique()
|
Query methods |
Returns the Component pointed to by this JSComponent .
|
getValidUnique()
|
Query methods |
Returns the only Component pointed to by this JSComponent which is capable of receiving events.
|
gotFocus()
|
Send event methods |
Sends a FOCUS_GAINED FocusEvent.
|
hasMember(String)
|
Find methods |
Returns any components of JSComponent that match the type you specify.
|
hasMember(String, String)
|
Find methods |
Returns a JSComponent that contains the subset of this JSComponent 's Components which contain at least one member matching the specification.
|
hasMemberRE(String, String)
|
Find methods |
Same as hasMember() , except this method accepts regular expressions for the Component title.
|
hasMemberRX(String, String)
|
Deprecated methods |
Equivalent to hasMemberRE() , except that this method uses the old regular expression syntax.
|
iconify()
|
Send event methods |
Sends a WINDOW_ICONIFY event.
|
isUnique()
|
Query methods |
Returns true if there is exactly one Component contained by this JSComponent .
|
isValidUnique()
|
Query methods | Returns true if there is one valid match that can receive events. |
key(int, int)
|
Send event methods |
Sends a KEY_PRESSED KeyEvent.
|
key(int, int, int, int)
|
Send event methods | Typing simulation event. |
keyPressed(int, char, int)
|
Send event methods |
Sends a KEY_PRESSED KeyEvent.
|
keyReleased(int, char, int)
|
Send event methods |
Sends a KEY_RELEASED KeyEvent.
|
keyTyped(char)
|
Send event methods |
Sends a KEY_TYPED KeyEvent.
|
keyTyped(int, int)
|
Deprecated methods |
Sends a KEY_TYPED KeyEvent. Replaced by keyTyped(char) .
|
keyUp(int, int)
|
Send event methods |
Sends a KEY_RELEASED KeyEvent.
|
lineDown(int)
|
Scrolling methods | Scrolls down one line. |
lineUp(int)
|
Scrolling methods | Scrolls up one line. |
lookup(String)
|
Find methods | Finds any components with a matching name contained in the components. |
lostFocus()
|
Send event methods |
Sends a FOCUS_LOST FocusEvent.
|
member(String)
|
Find methods | Finds contained members which have an exact type match. |
member(String, String)
|
Find methods | Finds contained members which have exact type and label matches. |
member(String, int)
|
Find methods | Finds a member which have an exact type match. |
member(String, String, int) | Find methods | Finds a member which has an exact type and label match. Uses a depth-first seach. |
memberRE(String, String)
|
Find methods | Finds contained members which have a type and a label matching a regular expression. |
memberRX(String, String)
|
Deprecated methods | Finds contained members which have a type and a label matching regular expression. Uses old regular expression syntax. |
menubar()
|
Find methods | Returns the menubar. Valid only for Frames. |
mouseClick(int, int, int)
|
Deprecated methods |
Sends a MOUSE_CLICKED event.
|
mouseClicked(int, int, int)
|
Send event methods |
Sends a MOUSE_CLICKED MouseEvent.
|
mouseDown(int, int, int)
|
Deprecated methods |
Sends a MOUSE_DOWN event.
|
mouseDrag(int, int, int)
|
Deprecated methods |
Sends a MOUSE_DRAG event.
|
mouseDragged(int, int, int)
|
Send event methods |
Sends a MOUSE_DRAGGED MouseEvent.
|
mouseEnter(int, int)
|
Deprecated methods |
Sends a MOUSE_ENTER event.
|
mouseEntered(int, int)
|
Send event methods |
Sends a MOUSE_ENTERED MouseEvent.
|
mouseExit(int, int)
|
Deprecated methods |
Sends a MOUSE_EXIT event.
|
mouseExited(int, int)
|
Send event methods |
Sends a MOUSE_EXITED MouseEvent.
|
mouseMove(int, int, int)
|
Deprecated methods |
Sends a MOUSE_MOVE event.
|
mouseMoved(int, int)
|
Send event methods |
Sends a MOUSE_MOVED MouseEvent.
|
mousePressed(int, int, int)
|
Send event methods |
Sends a MOUSE_PRESSED MouseEvent.
|
mouseReleased(int, int, int)
|
Send event methods |
Sends a MOUSE_RELEASED MouseEvent.
|
mouseUp(int, int, int)
|
Deprecated methods |
Sends a MOUSE_UP event.
|
multiClick(int, int, int, int)
|
Send event methods |
Sends multiple groups of MOUSE_PRESSED , MOUSE_RELEASED , and MOUSE_CLICKED events.
|
north(String, String)
|
Find methods | Returns the North member, requiring that it meet specified type and label requirements. |
orphan(String)
|
Deprecated methods | Finds Components whose ancestor is this, but who are not children of this, and that have an exact type match. |
pageDown(int)
|
Scrolling methods | Scrolls down a page. |
pageUp(int)
|
Scrolling methods | Scrolls up a page. |
popup(String)
|
Find methods | Returns all popups with the specified label. |
popup(String, int)
|
Find methods | Returns all popups with the specified label, and includes a count. |
popupTrigger(int, int)
|
Send event methods | Sends the PopupTrigger MouseEvent appropriate for the platform. |
readString()
|
Convenience methods | Returns the String value of the component. |
relativefile(String, String)
|
Send event methods | FileDialog simulation event, |
select()
|
Send event methods |
Sets the state of a Checkbox (sends a SELECTED ItemEvent).
|
select(int)
|
Send event methods | Selects the indexed entry of a List. |
select(String)
|
Send event methods | Selects an item in a List. |
select(int, String)
|
Send event methods | Selects the indexed entry of a List. Requires that the text of the item match. |
south(String, String)
|
Find methods | Returns the South member, requiring that it meet specified type and label requirements. |
synchronize(Script, String, String)
|
Comparison methods | Waits until the component matches the specified gold file. If timeout occurs before a match, SyncException occurs. |
typeString(String)
|
Send event methods |
Sends KEY_PRESS and KEY_RELEASE events for each character in the String, to type the entire string.
|
typeString(String, int, int)
|
Send event methods |
Same as typeString(String) , except that you specify the start and end position for the string.
|
verify(Script, boolean, String)
|
Comparison methods | Verify whether or not the component is capable of receiving events (see isValidUnique). |
verify(Script, String, String)
|
Comparison methods | Verify that the component has the specified string value. |
verifyWithFile(Script, String, String)
|
Comparison methods | Verify the component against the specified gold file. |
verifyAnyField(Script, boolean, boolean, String, Object, String)
|
Comparison methods | Reads the data member name on the contained Component and compares this against the expected value. |
verifyAnyMethod(Script, boolean, boolean, String, Object, String)
|
Comparison methods | Calls the method name() on the contained Component and compares it against the expected value. |
waitFor(boolean, String)
|
Comparison methods |
Waits until a Component pointed to by this JSComponent is correctly enabled or disabled.
|
waitFor(String)
|
Comparison methods |
Waits until a Component pointed to by this JSComponent is capable of receiving events.
|
west(String, String)
|
Find methods |
Waits until a Component pointed to by this JSComponent contains str.
|
west(String, String)
|
Find methods | Returns the West member, requiring that it meet specified type and label requirements. |
windowMoved(int, int, int, int)
|
Send event methods | Window simulation event that reshapes the Window as specified. |
Category | Method | Description |
---|---|---|
Comparison methods These methods compare component state to expected values or verify the state of attributes. |
synchronize(Script, String, String)
|
Waits until the component matches the specified gold file. If timeout occurs before a match, SyncException occurs. |
verify(Script, boolean, String)
|
Verify whether or not the component is capable of receiving events (see isValidUnique). | |
verify(Script, String, String)
|
Verify that the component has the specified string value. | |
verifyWithFile(Script, String, String)
|
Verify the component against the specified gold file. | |
verifyAnyField(Script, boolean, boolean, String, Object, String)
|
Reads the data member name on the contained Component and compares this against the expected value. | |
verifyAnyMethod(Script, boolean, boolean, String, Object, String)
|
Calls the method name() on the contained Component and compares it against the expected value. | |
waitFor(boolean, String)
|
Waits until a Component pointed to by this JSComponent is correctly enabled or disabled.
|
|
waitFor(String)
|
Waits until a Component pointed to by this JSComponent is capable of receiving events.
|
|
Convenience methods Convenience methods are a grouping of miscellaneous methods that perform functions on Components. |
getAnyField(String)
|
Returns the value of the data member name on the contained Component. |
readString()
|
Returns the String value of the component. | |
getAnyMethod(String)
|
Returns the value of the method name() on the contained Component.
|
|
Deprecated methods These methods will be phased out of JavaStar in the future, but are included in this release to support scripts written with earlier versions of the JavaStar library. |
buttonRX(String)
|
Finds contained buttons which have labels matching this regular expression. Uses old syntax for regular expressions. |
dialogRX(String)
|
Returns dialogs that have a title matching this regular expression. | |
dialogRX(String, String)
|
Returns dialogs that meet specified type and title matching regular expression. | |
hasMemberRX(String, String)
|
Equivalent to hasMemberRE() , except that this method uses the old regular expression syntax.
|
|
keyTyped(int, int)
|
Sends a KEY_TYPED KeyEvent. Replaced by keyTyped(char) .
|
|
memberRX(String, String)
|
Finds contained members which have a type and a label matching regular expression. Uses old regular expression syntax. | |
mouseClick(int, int, int)
|
Sends a MOUSE_CLICKED event.
|
|
mouseDown(int, int, int)
|
Sends a MOUSE_DOWN event.
|
|
mouseDrag(int, int, int)
|
Sends a MOUSE_DRAG event.
|
|
mouseEnter(int, int)
|
Sends a MOUSE_ENTER event.
|
|
mouseExit(int, int)
|
Sends a MOUSE_EXIT event.
|
|
mouseMove(int, int, int)
|
Sends a MOUSE_MOVE event.
|
|
mouseUp(int, int, int)
|
Sends a MOUSE_UP event.
|
|
orphan(String)
|
Finds Components whose ancestor is this, but who are not children of this, and that have an exact type match. | |
Find methods
Find methods locate a component based on its label, position, or other attributes. Most find methods return a JSComponent or JSMenuComponent .
|
ageDifferentiation(int, int)
|
Disambiguates based on relative construction time (approximately). |
button(String)
|
Finds contained buttons which have an exact label match. | |
buttonRE(String)
|
Finds contained buttons which have labels matching this regular expression. | |
center(String, String)
|
Returns the Center member that meets the specified type and label requirements. | |
child(int, String, String)
|
Returns a child component that meets the specified type and label requirements. | |
dialog(String)
|
Returns dialogs of this Frame whose title matches title. | |
dialog(String, String)
|
Returns dialogs of this Frame that meet specified type and title requirements. | |
dialogRE(String)
|
Returns dialogs that have title matching regular expression. | |
dialogRE(String, String)
|
Returns dialogs of this Frame of the specified type that have title matching regular expression. | |
east(String, String)
|
Returns the East member, requiring that it meet specified type and label requirements. | |
hasMember(String)
|
Returns any components of JSComponent that match the type you specify.
|
|
hasMember(String, String)
|
Returns a JSComponent that contains the subset of this JSComponent 's Components which contain at least one member matching the specification.
|
|
hasMemberRE(String, String)
|
Same as hasMember() , except this method accepts regular expressions for the Component title.
|
|
lookup(String)
|
Finds any components with a matching name contained in the components. | |
member(String)
|
Finds contained members which have an exact type match. | |
member(String, String)
|
Finds contained members which have exact type and label matches. | |
member(String, String, int) | Finds a member which has an exact type and label match. Uses a depth-first seach. | |
member(String, int)
|
Finds a member which have an exact type match. | |
memberRE(String, String)
|
Finds contained members which have a type and a label matching a regular expression. | |
menubar()
|
Returns the menubar. Valid only for Frames. | |
north(String, String)
|
Returns the North member, requiring that it meet specified type and label requirements. | |
popup(String)
|
Returns all popups with the specified label. | |
popup(String, int)
|
Returns all popups with the specified label, and includes a count. | |
south(String, String)
|
Returns the South member, requiring that it meet specified type and label requirements. | |
west(String, String)
|
Waits until a Component pointed to by this JSComponent contains str.
|
|
west(String, String)
|
Returns the West member, requiring that it meet specified type and label requirements. | |
Query methods
These methods return Components pointed to by a JSComponent.
|
getAll()
|
Returns all Components pointed to by this JSComponent .
|
getAllValid()
|
Returns all Components pointed to by this JSComponent which are capable of receiving events.
|
|
getUnique()
|
Returns the Component pointed to by this JSComponent .
|
|
getValidUnique()
|
Returns the only Component pointed to by this JSComponent which is capable of receiving events.
|
|
isUnique()
|
Returns true if there is exactly one Component contained by this JSComponent .
|
|
isValidUnique()
|
Returns true if there is one valid match that can receive events. | |
Scrolling methods These methods scroll a TextComponent to the position you specify. |
absolute(int)
|
Scrolls to the position you specify. |
pageDown(int)
|
Scrolls down a page. | |
pageUp(int)
|
Scrolls up a page. | |
lineDown(int)
|
Scrolls down one line. | |
lineUp(int)
|
Scrolls up one line. | |
Send event methods These methods send events to GUI components. |
action()
|
Sends an ACTION event to a Button or Textfield.
|
action(String)
|
Sends an action event to Button, Choice, List, or TextField. | |
buttonPress()
|
Sends MOUSE_PRESSED , MOUSE_RELEASED , MOUSE_CLICKED , and the ActionEvent. Valid only for Buttons.
|
|
choosefile(String, String)
|
FileDialog simulation event. | |
deiconify()
|
Sends a WINDOW_DEICONIFY event.
|
|
deselect()
|
Sends a DESELECTED ItemEvent to a Checkbox.
|
|
deselect(int)
|
Deselects the indexed entry of a List. | |
deselect(String)
|
Deselects an item in a List. | |
deselect(int, String)
|
Deselects the indexed entry of a List. Requires that the text of the item match. | |
destroy()
|
Sends a WINDOW_CLOSING event.
|
|
fkey(int, int)
|
Sends a KEY_ACTION KeyEvent.
|
|
Send event methods, continued |
fkeyUp(int, int)
|
Sends a KEY_ACTION_RELEASE KeyEvent.
|
gotFocus()
|
Sends a FOCUS_GAINED FocusEvent.
|
|
iconify()
|
Sends a WINDOW_ICONIFY event.
|
|
key(int, int)
|
Sends a KEY_PRESSED KeyEvent.
|
|
key(int, int, int, int)
|
Typing simulation event. | |
keyPressed(int, char, int)
|
Sends a KEY_PRESSED KeyEvent.
|
|
keyReleased(int, char, int)
|
Sends a KEY_RELEASED KeyEvent.
|
|
keyTyped(char)
|
Sends a KEY_TYPED KeyEvent.
|
|
keyUp(int, int)
|
Sends a KEY_RELEASED KeyEvent.
|
|
lostFocus()
|
Sends a FOCUS_LOST FocusEvent.
|
|
mouseClicked(int, int, int)
|
Sends a MOUSE_CLICKED MouseEvent.
|
|
mouseDragged(int, int, int)
|
Sends a MOUSE_DRAGGED MouseEvent.
|
|
mouseEntered(int, int)
|
Sends a MOUSE_ENTERED MouseEvent.
|
|
mouseExited(int, int)
|
Sends a MOUSE_EXITED MouseEvent.
|
|
mouseMoved(int, int)
|
Sends a MOUSE_MOVED MouseEvent.
|
|
mousePressed(int, int, int)
|
Sends a MOUSE_PRESSED MouseEvent.
|
|
mouseReleased(int, int, int)
|
Sends a MOUSE_RELEASED MouseEvent.
|
|
multiClick(int, int, int, int)
|
Sends multiple groups of MOUSE_PRESSED , MOUSE_RELEASED , and MOUSE_CLICKED events.
|
|
popupTrigger(int, int)
|
Sends the PopupTrigger MouseEvent appropriate for the platform. | |
relativefile(String, String)
|
FileDialog simulation event, | |
select()
|
Sets the state of a Checkbox (sends a SELECTED ItemEvent).
|
|
select(int)
|
Selects the indexed entry of a List. | |
select(String)
|
Selects an item in a List. | |
select(int, String)
|
Selects the indexed entry of a List. Requires that the text of the item match. | |
typeString(String)
|
Sends KEY_PRESS and KEY_RELEASE events for each character in the String, to type the entire string.
|
|
typeString(String, int, int)
|
Same as typeString(String) , except that you specify the start and end position for the string.
|
|
Send event methods, continued |
windowMoved(int, int, int, int)
|
Window simulation event that reshapes the Window as specified. |
public void action()
Send event method
Valid only for Buttons and TextFields: sends an ACTION
event with the appropriate String arg (the current button label or textfield text).
public void action(String text)
Send event method
Sends an action event to Button, Choice, List, TextField.
public void buttonPress()
Send event method
Valid only for Buttons. Sends MOUSE_PRESSED
, MOUSE_RELEASED
, MOUSE_CLICKED
, and the ActionEvent. For non-Buttons, sends only the three mouse events, at the center of the Component.
public void choosefile(String dir, String file)
Send event method
FileDialog simulation event. Valid only for FileDialogs.
public void deiconify()
Send event method
Sends a WINDOW_DEICONIFY
event.
public void deselect()
Send event method
Sets the state of a Checkbox (sends a DESELECTED
ItemEvent).
public void deselect(int index)
Send event method
Deselects the indexed entry of a List.
public void deselect(String item)
Send event method
Deselects an item in a List.
public void deselect(int index, String item)
Send event method
Deselects the indexed entry of a List. Requires that the text of the item match.
public void destroy()
Send event method
Sends a WINDOW_CLOSING
event.
public void fkey(int keycode, int modifiers)
Send event method
Sends a KEY_ACTION
KeyEvent.
public void fkeyUp(int keycode, int modifiers)
Send event method
Sends a KEY_ACTION_RELEASE
KeyEvent.
public void gotFocus()
Send event method
Sends a FOCUS_GAINED
FocusEvent.
public void iconify()
Send event method
Sends a WINDOW_ICONIFY
event.
public void key(int keychar, int modifiers)
Send event method
Sends a KEY_PRESSED
KeyEvent.
public void key(int key, int modifiers, int selectionStart, int selectionEnd)
Send event method
Typing simulation event--valid only for TextComponents.
public void keyPressed(int keyCode, char keyChar, int modifiers)
Send event method
Sends a KEY_PRESSED
KeyEvent.
public void keyReleased(int keyCode, char keyChar, int modifiers)
Send event method
Sends a KEY_RELEASED
KeyEvent.
public void keyTyped(char keyChar)
Send event method
Sends a KEY_TYPED
KeyEvent.
public void keyUp(int keychar, int modifiers)
Send event method
Sends a KEY_RELEASED
KeyEvent.
public void lostFocus()
Send event method
Sends a FOCUS_LOST
FocusEvent.
public void mouseClicked(int x, int y, int modifiers)
Send event method
Send event method
Sends a MOUSE_CLICKED
MouseEvent.
public void mouseDragged(int x, int y, int modifiers)
Send event method
Sends a MOUSE_DRAGGED
MouseEvent.
public void mouseEntered(int x, int y)
Send event method
Sends a MOUSE_ENTERED
MouseEvent.
pubic void mouseExited(int x, int y)
Send event method
Sends a MOUSE_EXITED
MouseEvent.
pubic void mouseMoved(int x, int y, int modifiers)
Send event method
Sends a MOUSE_MOVED
MouseEvent.
pubic void mousePressed(int x, int y, int modifiers)
Send event method
Sends a MOUSE_PRESSED
MouseEvent.
pubic void mouseReleased(int x, int y, int modifiers)
Send event method
Sends a MOUSE_RELEASED
MouseEvent.
public void multiClick(int x, int y, int modifiers, int count)
Send event method
Simulation event. This method sends multiple groups of MOUSE_PRESSED
, MOUSE_RELEASED
, and MOUSE_CLICKED
events.
You can use this method to simulate a double-click--for example, multiClick(x, y, 0, 2)
. For Buttons, this method sends an ACTION
even after each CLICKED
.
pubic void popupTrigger(int x, int y)
Send event method
Sends the PopupTrigger MouseEvent appropriate for the platform. (On Solaris, a MOUSE_RELEASED
; on Windows, a MOUSE_PRESSED
).
public void select()
Send event method
Sets the state of a Checkbox (sends a SELECTED
ItemEvent).
public void select(int index)
Send event method
Selects the indexed entry of a List.
public void select(String item)
Send event method
Selects an item in a List.
public void select(int index, String item)
Send event method
Selects the indexed entry of a List. Requires that the text of the item match.
public void typeString(String data)
Send event method
Sends KEY_PRESS
and KEY_RELEASE
events for each character, to type the entire string. For TextComponents, this will select the entire contents and overwrites it.
public void typeString(String data, int selectionStart, int selectionEnd)
Send event method
Valid only for TextComponents: sends KEY_PRESS
and KEY_RELEASE
events for each character, to type the entire string into the TextComponent.
public relativefile(String rdir, String fil)
Send event method
FileDialog simulation event - valid only for FileDialogs.
public void windowMoved(int x, int y, int width, int height)
Send event method
Window simulation event that sizes and positions the Window as specified. Valid only for Window Components.
public JSComponent ageDifferentiation(int position, int total)
Find method
Disambiguates Components based on their relative construction time.
public JSComponent button(String val)
Find method
Finds contained buttons which have an exact label match.
pubic JSComponent buttonRE(String val)
Find method
Finds contained buttons which have labels matching this regular expression. See Current Syntax in the chapter "Syntax for Regular Expressions."
public JSComponent center(String type, String label)
Find method
Returns the Center member that meets the specified type and label requirements. Valid only for Containers with BorderLayouts.
public JSComponent child(int i, String type, String label)
Find method
Returns a child component that meets the specified type and label requirements. Valid only for Containers.
""
for non-Buttons)
public JSComponent dialog(String title)
Find method
Returns dialogs of this Frame whose title matches title. Valid only for Frames.
public JSComponent dialog(String type, String title)
Find method
Returns dialogs of this Frame that meet specified type and title requirements. Valid only for Frames.
pubic JSComponent dialogRE(String expression)
Find method
Returns dialogs that have title matching regular expression. See Current Syntax in the chapter "Syntax for Regular Expressions." Valid only for Frames.
pubic JSComponent dialogRE(String type, String expression)
Find method
Returns dialogs of this Frame of the specified type that have title matching regular expression. See Current Syntax in the chapter "Syntax for Regular Expressions." Valid only for Frames.
public JSComponent east(String type, String label)
Find method
Returns the East member, requiring that it meet specified type and label requirements. Valid only for Containers with BorderLayouts.
public JSComponent hasMember(String type)
Find method
Disambiguates - finds the subset of this JSComponent
's Component that contian at least one member of the type you specify. Returns a JSComponent
containing this subset.
public JSComponent hasMember(String type, String val)
Find method
Disambiguates - looks for a member of a this JSComponent that contains at least one member matching the type and val. Returns a JSComponent containing this subset.
pubic JSComponent hasMemberRE(String type, String expression)
Find method
Disambiguates - looks for a member of a this JSComponent that contains at least one member matching this type and have a label matching this regular expression. (See Current Syntax in the chapter "Syntax for Regular Expressions.") Returns a JSComponent containing this subset.
public JSComponent lookup(String name)
Find method
Finds any components with a matching name (return of the getName()
method) contained in the components returned by the getAll()
method.
This method uses `.' as a scope separator. For example, name of A.B
refers to a component named B
contained in a component named A
, where A
is contained within the current component. '#' must be used to escape
'.
'
public JSComponent member(String type)
Find method
Finds contained members which have an exact type match.
public JSComponent member(String type, String val)
Find method
Finds contained members which have exact type and label matches.
public JSComponent member(String type, String val, int position);
Find method
Finds a member which has an exact type and label match. Uses a depth-first search of the tree, return the position'th Component that matches.
pubic JSComponent member(String type, int position)
Find method
Finds a member which have an exact type match. With a depth-first search of the tree, returns the position of the Component matching the given type.
pubic JSComponent memberRE(String type, String expression)
Find method
Finds contained members which have a type matching type and a label matching this regular expression. See Current Syntax in the chapter "Syntax for Regular Expressions."
public JSMenuComponent menubar()
Find method
Returns the menubar. Valid only for Frames.
public JSComponent north(String type, String label)
Find method
Returns the North member, requiring that it meet specified type and label requirements. Valid only for Containers with BorderLayouts.
public JSMenuComponent popup(String label)
Find method
Returns all popups with the specified label.
public JSMenuComponent popup(String label, int count)
Find method
Returns all popups with the specified label.
public JSComponent south(String type, String label)
Find method
Returns the South member, requiring that it meet specified type and label requirements. Valid only for Containers with BorderLayouts.
public JSComponent west(String type, String label)
Find method
Returns the West member, requiring that it meet specified type and label requirements. Valid only for Containers with BorderLayouts.
public Component[] getAll()
Query method
Returns all Components pointed to by this JSComponent
.
public Component[] getAllValid()
Query method
Returns all Components pointed to by this JSComponent
which are capable of receiving events.
public Component getUnique()
Returns the Component pointed to by this JSComponent
. This requires that there is exactly one match, throwing an exception otherwise.
public Component getValidUnique()
Query method
Returns the only Component pointed to by this JSComponent
which is capable of receiving events. If there are no components capable of receiving events, or if more than one is capable of receiving, this method throws an exception.
public boolean isUnique()
Query method
Returns true
if there is exactly one Component contained by this JSComponent
.
public boolean isValidUnique()
Query method
Returns true if there is one valid match that can receive events.
public void synchronize(Script sc, String filename, String purpose)
Comparison method
Waits until the component matches the specified gold file. If timeout occurs before a match, SyncException
occurs.
public boolean verify(Script sc, boolean en, String purpose)
Comparison method
Verify whether or not the component is capable of receiving events (see isValidUnique
). Returns true
if the verify succeeds.
true
means this component must be capable of receiving events; false
means it must not be capable
public boolean verify(Script sc, String value, String purpose)
Comparison method
Verify that the component has the specified string value. Returns true
if verify succeeds.
public boolean verifyAnyField(Script sc, boolean sync, boolean retry, String name, Object expected, String purpose)
Comparison method
Reads the data member name on the contained Component and compares this against the expected value.
public boolean verifyAnyMethod(Script sc, boolean sync, boolean retry, String name, Object expected, String purpose)
Comparison method
Calls the method name() on the contained Component and compares it against the expected value. Returns true
or false
depending on the comparison results.
public boolean verifyWithFile(Script sc, String filename, String purpose)
Comparison method
Verify the component against the specified gold file. Returns true
if the verify succeeds.
public void waitFor(boolean enabled, String purpose)
Comparison method
Waits until a Component pointed to by this JSComponent
is correctly enabled or disabled. If a timeout occurs, this method throws a GUINotAcceptingException.
public void waitFor(String purpose)
Comparison method
Waits until a Component pointed to by this JSComponent
is capable of receiving events. If timeout occurs, this method throw a GUINotAcceptingException
.
public void waitFor(String str, String purpose)
Comparison method
Waits until a Component pointed to by this JSComponent
contains str. Valid for Frames, Dialogs, Labels, Buttons, TextAreas, and TextFields. Timeout will cause GUINotAcceptingException
.
public void absolute(int position)
Scrolling method
Scrolls to position and sends a TRACK
AdjustmentEvent.
public void lineDown(int position)
Scrolling method
Scrolls to position and sends a UNIT_DECREMENT
AdjustmentEvent.
public void lineUp(int position)
Scrolling method
Scrolls to position and sends a UNIT_INCREMENT
AdjustmentEvent.
public void pageDown(int position)
Scrolling method
Scrolls to position and sends a BLOCK_DECREMENT
AdjustmentEvent.
public void pageUp(int position)
Scrolling method
Scrolls to position and sends a BLOCK_INCREMENT
AdjustmentEvent.
public Object getAnyField(String name) throws NoSuchFieldException, IllegalAccessException
Convenience method
This convenience function returns the value of the data member name on the contained Component.
public Object getAnyMethod(String name) throws noSuchMethodException, IllegalAccessException, InvocationTargetException
Convenience method
This convenience function returns the value of the method name() on the contained Component.
public String readString()
Convenience method
Returns the String value of the component. The value returned is based on the component type:
public JSComponent buttonRX(String val)
Deprecated method
Replaced by buttonRE(String).
Finds contained buttons which have labels matching this regular expression (see Current Syntax in the chapter "Syntax for Regular Expressions.").
public JSComponent orphan(String type)
Deprecated method
This method is obsolete; there is no replacement.
Finds Components whose ancestor is this, but who are not children of this, and that have an exact type match.
Note - This may be generated by a record. Usually this indicates unusual usage of the AWT (such as overriding getComponents()
or getParent()
methods).
public JSComponent dialogRX(String expression)
Deprecated method
Replaced by dialogRE(String).
Returns dialogs that have a title matching this regular expression (see Current Syntax in the chapter "Syntax for Regular Expressions"). Valid only for Frames.
public JSComponent dialogRX(String type, String expression)
Deprecated method
Replaced by dialogRE(String, String).
Returns dialogs that meet specified type and title matching regular expression (see Current Syntax in the chapter "Syntax for Regular Expressions"). Valid only for Frames.
public JSComponent hasMemberRX(String type, String expression)
Deprecated method
Replaced by hasMemberRE(String, String).
Disambiguates - returns a JSComponent
that contains the subset of this JSComponent
's Components which contain at least one member which have type & label matching regular expression (see Current Syntax in the chapter "Syntax for Regular Expressions").
pubic void keyTyped(int keyChar, int modifiers)
Deprecated method
Replaced by keyTyped(char).
Backward-compatibility only - not recommended. Sends a KEY_TYPED
KeyEvent.
public JSComponent memberRX(String type, String expression)
Deprecated method
Replaced by memberRE(String, String).
Finds contained members which have a type and a label matching regular expression (see the chapter "Syntax for Regular Expressions").
public void mouseClick(int x, int y, int modifiers)
Deprecated method
Replaced by mouseClicked(int, int, int).
Sends a MOUSE_CLICKED
event.
public void mouseDown(int x, int y, int modifiers)
Deprecated method
Replaced by mousePressed(int, int, int).
Sends a MOUSE_DOWN
event.
public void mouseDrag(int x, int y, int modifiers)
Deprecated method
Replaced by mouseDragged(int, int, int).
Sends a MOUSE_DRAG
event.
public void mouseEnter(int x, int y)
Deprecated method
Replaced by mouseEntered(int, int).
Sends a MOUSE_ENTER
event.
public void mouseExit(int x, int y)
Deprecated method
Replaced by mouseExited(int, int).
Sends a MOUSE_EXIT
event.
public void mouseMove(int x, int y, int modifiers)
Deprecated method
Replaced by mouseMoved(int, int).
Sends a MOUSE_MOVE
event.
public void mouseUp(int x, int y, int modifiers)
Deprecated method
Replaced by mouseReleased(int, int, int).
Sends a MOUSE_UP
event.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.