super(new String[] {"org.netbeans.jemmy.operators.JComboBoxOperator"});
queueTool = new QueueTool();
}
public void selectItem(ComponentOperator oper, int index) {
JComboBoxOperator coper = (JComboBoxOperator)oper;
//1.5 workaround
if(System.getProperty("java.specification.version").compareTo("1.4") > 0) {
queueTool.setOutput(oper.getOutput().createErrorOutput());
queueTool.waitEmpty(10);
queueTool.waitEmpty(10);
queueTool.waitEmpty(10);
}
//end of 1.5 workaround
if(!coper.isPopupVisible()) {
if(UIManager.getLookAndFeel().getClass().getName().equals("com.sun.java.swing.plaf.motif.MotifLookAndFeel")) {
oper.clickMouse(oper.getWidth() - 2, oper.getHeight()/2, 1);
} else {
DriverManager.getButtonDriver(coper.getButton()).
push(coper.getButton());
}
}
JListOperator list = new JListOperator(coper.waitList());
list.copyEnvironment(coper);
list.setVisualizer(new EmptyVisualizer());
coper.getTimeouts().sleep("JComboBoxOperator.BeforeSelectingTimeout");
DriverManager.getListDriver(list).
selectItem(list, index);
}