XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
XExtendedToolkit.class, toolkit);
shortWait();
AccessibilityTools at = new AccessibilityTools();
Object atw = tk.getActiveTopWindow();
XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
atw);
XAccessible xRoot = at.getAccessibleObject(xWindow);
XAccessibleContext ARoot = at.getAccessibleObjectForRole(xRoot,
AccessibleRole.MENU_BAR);
XAccessibleSelection sel = (XAccessibleSelection) UnoRuntime.queryInterface(
XAccessibleSelection.class, ARoot);
for (int k = 0; k < indexes.length; k++) {
try {
sel.selectAccessibleChild(indexes[k]);
shortWait();
ARoot = ARoot.getAccessibleChild(indexes[k])
.getAccessibleContext();
sel = (XAccessibleSelection) UnoRuntime.queryInterface(
XAccessibleSelection.class, ARoot);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
}
}
shortWait();
atw = tk.getActiveTopWindow();
xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw);
xRoot = at.getAccessibleObject(xWindow);
//at.printAccessibleTree(new PrintWriter(System.out),xRoot);
XAccessibleAction action = (XAccessibleAction) UnoRuntime.queryInterface(
XAccessibleAction.class,
at.getAccessibleObjectForRole(xRoot,
AccessibleRole.PUSH_BUTTON,
bName));
try {
action.doAccessibleAction(0);
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
}
shortWait();
atw = tk.getActiveTopWindow();
xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, atw);
xRoot = at.getAccessibleObject(xWindow);
at.printAccessibleTree(new PrintWriter(System.out),xRoot);
action = (XAccessibleAction) UnoRuntime.queryInterface(
XAccessibleAction.class,
at.getAccessibleObjectForRole(xRoot,
AccessibleRole.PUSH_BUTTON,
"Yes"));
try {
if (action != null) action.doAccessibleAction(0);