JSNonComponentLocator
is a class that you implement to identify non-component objects inside Components. You only need to implement this class if you are building your user interface using a toolkit that is not based on the Java AWT model (and the components do not derive from java.awt.Component
).
JavaStar already provides locators for the Bongo toolkit (by Marimba) and the Netscape Internet Foundation Classes. You can use the source for these locators as an example of how to implement this class--look in the \javastar\contrib\locators
directory.
Note - To read more about JavaStar locators, see the chapter "Locators for Non-Components" in the JavaStar User's Manual.
suntest.javastar.lib.JSNonComponentLocator
public interface JSNonComponentLocator
Method | Description |
---|---|
findObject(Component, AWTevent) |
Called during recording or inspection--translates a Component and AWTevent into a JSNCLData object containing locator information for a non-component.
|
getNamedObjectData(Component, String) |
Called during playback--translates a string from the test code into a JSNCLData object that includes the screen coordinates where JavaStar can execute the event specified by the test.
|
public JSNCLData findObject(Component c, AWTEvent e)
Called during recording or inspection--when sent a component location and an AWTevent
, this method returns a JSNCLData
object containing a locator string to serve as the name for the non-component. If findObject()
returns null, this indicates that the locator does not know of any non-component appropriate for this event.
Note - If all locators return null, the event will be recorded on the component itself.
AWTEvent
to send to the Component
public JSNCLData getNamedObjectData(Component c, String wname)
When passed a Component and a non-component name (wname), this method returns a JSNCLData
object containing the screen location of the component. If getNamedObjectData()
returns null
, this method should throw GUINotFoundException
or AmbiguousGUIException
, as appropriate.
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.