super(new Timeout("apple.system.menu.delay", 100),
new String[] {"org.netbeans.jemmy.operators.JMenuBarOperator"});
}
public Object pushMenu(ComponentOperator oper, PathChooser chooser) {
Timeout maxTime = oper.getTimeouts().create("ComponentOperator.WaitComponentTimeout");
JMenuBar bar = (JMenuBar)(oper.getSource());
activateMenu(bar);
MenuElement menuObject;
maxTime.start();
while(!chooser.checkPathComponent(0, (menuObject = getSelectedElement(bar)))) {
pressKey(KeyEvent.VK_RIGHT, 0);
releaseKey(KeyEvent.VK_RIGHT, 0);
if(maxTime.expired()) {
throw(new TimeoutExpiredException("AppleMenuDriver: can not find an appropriate menu!"));
}
}
for(int depth = 1; depth < chooser.getDepth(); depth++) {
// TODO - wait for menu item