XModel aModel = (XModel) UnoRuntime.queryInterface(XModel.class,
xTextDoc);
XInterface oObj = null;
AccessibilityTools at = new AccessibilityTools();
XWindow xWindow = at.getCurrentWindow(
(XMultiServiceFactory) tParam.getMSF(),
aModel);
XAccessible xRoot = at.getAccessibleObject(xWindow);
oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PANEL);
XAccessibleComponent window = (XAccessibleComponent) UnoRuntime.queryInterface(
XAccessibleComponent.class, oObj);
point = window.getLocationOnScreen();
Rectangle rect = window.getBounds();
try {
Robot rob = new Robot();
int x = point.X + (rect.Width / 2);
int y = point.Y + (rect.Height / 2);
rob.mouseMove(x, y);
rob.mousePress(InputEvent.BUTTON3_MASK);
rob.mouseRelease(InputEvent.BUTTON3_MASK);
} catch (java.awt.AWTException e) {
log.println("couldn't press mouse button");
}
shortWait(tParam);
XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
XExtendedToolkit.class, toolkit);
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");
}
oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.POPUP_MENU);
log.println("ImplementationName: " + util.utils.getImplName(oObj));
TestEnvironment tEnv = new TestEnvironment(oObj);