log.println("could not get Toolkit " + e.toString());
}
XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
XExtendedToolkit.class, toolkit);
XAccessible xRoot = null;
AccessibilityTools at = new AccessibilityTools();
try {
xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
tk.getTopWindow(0));
xRoot = at.getAccessibleObject(xWindow);
at.printAccessibleTree(log, xRoot, tParam.getBool(util.PropertyName.DEBUG_IS_ACTIVE));
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
log.println("Couldn't get Window");
}
XAccessibleContext oPopMenu = at.getAccessibleObjectForRole(xRoot, AccessibleRole.POPUP_MENU,true);
log.println("ImplementationName: " + util.utils.getImplName(oPopMenu));
XAccessible xHelp = null;
try{
log.println("Try to get second entry of context menu...");
xHelp = oPopMenu.getAccessibleChild(1);
} catch (IndexOutOfBoundsException e){
throw new StatusException("Not possible to get second entry of context menu",e);
}
if (xHelp == null) throw new StatusException(new Status("second entry of context menu is NULL", false));
XAccessibleContext xHelpCont = xHelp.getAccessibleContext();
if ( xHelpCont == null )
throw new StatusException(new Status("No able to retrieve accessible context from first entry of context menu",false));
String aAccessibleName = xHelpCont.getAccessibleName();