The suntest.javastar.lib.JSMenuComponent
interface is constructed with one or more java.awt.MenuComponent
objects, allowing simple tests of its contents. As an interface, you cannot instantiate JSMenuComponent
, but you can obtain a JSMenuComponent
and JSComponent.menubar()
using JS.mlookup()
.
This section describes JSMenuComponent
by:
suntest.javastar.lib.JSMenuComponent
public interface JSMenuComponent
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 |
---|---|---|
action()
|
Send event methods | Sends an action event referencing this MenuItem. |
deselect()
|
Send event methods |
Sets the state of a CheckboxMenuItem to false (sends a DESELECTED ItemEvent).
|
getAll()
|
Query methods |
Returns all MenuComponents pointed to by this JSMenuComponent .
|
getUnique()
|
Query methods |
Returns the MenuComponent pointed to by this JSMenuComponent . This requires that there is exactly one match.
|
getValidUnique()
|
Query methods |
Returns the only MenuComponent pointed to by this JSMenuComponent which is capable of receiving events.
|
isUnique()
|
Query methods | Returns true if there is exactly one JSMenuComponent contained by this. |
isValidUnique()
|
Query methods |
Returns true if there is one valid match that can receive events.
|
item(String)
|
Find methods | Returns the MenuItem(s) whose label matches label. |
item(int, String)
|
Find methods | Returns the specified MenuItem, requiring its label to match label. |
menu(String)
|
Find methods | Returns the menu(s) whose label matches the String you provide. |
menu(int, String)
|
Find methods | Returns the specified menu, requiring its label match the String you provide. |
mlookup(String)
|
Find methods | Find contained Named JSMenuComponents whose name matches the String you provide. |
nested(String)
|
Find methods | Returns the nested Menu(s) whose label matches the String you provide. |
nested(int, String)
|
Find methods | Returns the specified nested Menu, requiring its label to match the String you provide. |
select()
|
Send event methods |
Sets the state of a CheckboxMenuItem to true (sends a SELECTED ItemEvent).
|
public void action()
Send event method
Sends an action event referencing this MenuItem. Only applicable when the contained MenuComponent is a MenuItem.
public void deselect()
Send event method
Sets the state of a CheckboxMenuItem to false (sends a DESELECTED
ItemEvent). Only Applicable when contained MenuComponent is CheckboxMenuItem.
public MenuComponent[] getAll()
Query method
Returns all MenuComponents pointed to by this JSMenuComponent
.
public MenuComponent getUnique()
Query method
Returns the MenuComponent pointed to by this JSMenuComponent
. This requires that there is exactly one match, and throws an exception if there is not.
public MenuComponent getValidUnique()
Query method
Returns the only MenuComponent pointed to by this JSMenuComponent
which is capable of receiving events. If there is no component capable of receiving, or if more than one component can receive, this method throws an exception.
public boolean isUnique()
Query method
Returns true
if there is exactly one MenuComponent contained by this.
public boolean isValidUnique()
Query method
Returns true
if there is one valid match that can receive events.
public JSMenuComponent item(String label)
Find method
Returns the MenuItem(s) whose label matches label. Only applicable when contained MenuComponent is Menu. Note that this function will not return nested Menus--see nested(String).
public JSMenuComponent item(int position, String label)
Find method
Returns the specified MenuItem, requiring its label to match label. Only applicable when contained MenuComponent is Menu. Note that this function will not return nested Menus; see nested(int, String).
public JSMenuComponent menu(String label)
Find method
Returns the menu(s) whose label match label. Only applicable when contained MenuComponent is MenuBar.
public JSMenuComponent menu(int position, String label)
Find method
Returns the specified menu, requiring its label match label. Only applicable when contained MenuComponent is MenuBar.
public JSMenuComponent mlookup(String name)
Find method
Find contained Named MenuComponents whose name matches name.
public JSMenuComponent nested(String label)
Find method
Returns the nested Menu(s) whose label matches label. Only applicable when contained MenuComponent is Menu.
public JSMenuComponent nested(int position, String label)
Find method
Returns the specified nested Menu, requiring its label to match label. Only applicable when contained MenuComponent is Menu.
public void select()
Send event method
Sets the state of a CheckboxMenuItem to true (sends a SELECTED
ItemEvent). Only applicable when contained MenuComponent is CheckboxMenuItem.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.