{
}
// reuse the frame
com.sun.star.frame.XController xController = xFrame.getController();
XContextMenuInterception xContextMenuInterception = null;
XContextMenuInterceptor xContextMenuInterceptor = null;
if (xController != null)
{
System.out.println("Creating context menu interceptor");
// add our context menu interceptor
xContextMenuInterception =
UnoRuntime.queryInterface(XContextMenuInterception.class, xController);
if (xContextMenuInterception != null)
{
ContextMenuInterceptor aContextMenuInterceptor = new ContextMenuInterceptor(xBitmap);
xContextMenuInterceptor =
UnoRuntime.queryInterface(XContextMenuInterceptor.class, aContextMenuInterceptor);
System.out.println("Register context menu interceptor");
xContextMenuInterception.registerContextMenuInterceptor(xContextMenuInterceptor);
}
}
// utils.shortWait(10000);
openContextMenu(UnoRuntime.queryInterface(XModel.class, xDrawDoc));
checkHelpEntry();
// remove our context menu interceptor
if (xContextMenuInterception != null
&& xContextMenuInterceptor != null)
{
System.out.println("Release context menu interceptor");
xContextMenuInterception.releaseContextMenuInterceptor(
xContextMenuInterceptor);
}
}
catch (com.sun.star.uno.RuntimeException ex)
{