log.println("Couldn't get toolkit");
e.printStackTrace(log);
throw new StatusException("Couldn't get toolkit", e);
}
XExtendedToolkit tk = (XExtendedToolkit) UnoRuntime.queryInterface(
XExtendedToolkit.class, oObj);
XModel aModel1 = (XModel) UnoRuntime.queryInterface(XModel.class,
xTextDoc);
XController secondController = aModel1.getCurrentController();
XDispatchProvider aProv = (XDispatchProvider) UnoRuntime.queryInterface(
XDispatchProvider.class,
secondController);
XURLTransformer urlTransf = null;
try {
XInterface transf = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
"com.sun.star.util.URLTransformer");
urlTransf = (XURLTransformer) UnoRuntime.queryInterface(
XURLTransformer.class, transf);
} catch (com.sun.star.uno.Exception e) {
e.printStackTrace(log);
throw new StatusException("Couldn't create URLTransformer", e);
}
XDispatch getting = null;
log.println("opening HyperlinkDialog");
URL[] url = new URL[1];
url[0] = new URL();
url[0].Complete = ".uno:HyperlinkDialog";
urlTransf.parseStrict(url);
getting = aProv.queryDispatch(url[0], "", 0);
PropertyValue[] noArgs = new PropertyValue[0];
getting.dispatch(url[0], noArgs);
shortWait();
AccessibilityTools at = new AccessibilityTools();
XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class,
tk.getActiveTopWindow());
XAccessible xRoot = at.getAccessibleObject(xWindow);
oObj = at.getAccessibleObjectForRole(xRoot, AccessibleRole.PUSH_BUTTON,
"Close");