A text map class implements the JavaStar API JSTextMapping
interface, providing code for the computeText()
method. The only requirements of this method are that it accepts a Component as a parameter, and that it returns a String containing the text name (or null).
How you determine the text name depends on your program. This example shows how a text map for Swing (part of the Java Foundation Classes) looks:
package jfc;
import suntest.javastar.lib.JSTextMapping;
import java.awt.Component;
public class JfcTm implements JSTextMapping {
public String computeText(Component c){
if(c instanceof com.sun.java.swing.AbstractButton){
return ((com.sun.java.swing.AbstractButton)c).getText();
}
return null;
}
}
Send feedback to
JavaStar-feedback@suntest.com
Copyright © 1998
Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, CA 94303.
All rights reserved.