public ChoiceDriver() {
super(new String[] {"org.netbeans.jemmy.operators.ChoiceOperator"});
}
public void selectItem(ComponentOperator oper, int index) {
ChoiceOperator coper = (ChoiceOperator)oper;
Point pointToClick = getClickPoint(oper);
DriverManager.getMouseDriver(oper).
clickMouse(oper, pointToClick.x, pointToClick.y,
1, oper.getDefaultMouseButton(), 0,
oper.getTimeouts().create("ComponentOperator.MouseClickTimeout"));
KeyDriver kdriver = DriverManager.getKeyDriver(oper);
Timeout pushTimeout = oper.getTimeouts().create("ComponentOperator.PushKeyTimeout");
if(System.getProperty("java.specification.version").compareTo("1.3") > 0) {
while(coper.getSelectedIndex() != index) {
kdriver.pushKey(oper, (index > coper.getSelectedIndex()) ? KeyEvent.VK_DOWN : KeyEvent.VK_UP, 0, pushTimeout);
}
} else {
int current = ((ChoiceOperator)oper).getSelectedIndex();
int diff = 0;
int key = 0;