XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
try {
XInterface oInspector = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspector");
XObjectInspector xInspector = (XObjectInspector) UnoRuntime.queryInterface(XObjectInspector.class, oInspector);
log.println("ImplementationName '" + utils.getImplName(xInspector) + "'");
XInterface oInspectorModel = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspectorModel");
XObjectInspectorModel xInspectorModel = (XObjectInspectorModel)
UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModel);
XInterface oInspectorModelToSet = (XInterface) xMSF.createInstance("com.sun.star.inspection.ObjectInspectorModel");
XObjectInspectorModel xInspectorModelToSet = (XObjectInspectorModel)
UnoRuntime.queryInterface(XObjectInspectorModel.class, oInspectorModelToSet);
log.println("create a floating frame...");
XWindow xWindow = null;
try{
XWindowPeer xWindowPeer = DesktopTools.createFloatingWindow(xMSF);
xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xWindowPeer);
} catch (StatusException e){
throw new StatusException("Coud not create test object", e);
}
XInterface oFrame = (XInterface) xMSF.createInstance("com.sun.star.frame.Frame");
XFrame xFrame = (XFrame) UnoRuntime.queryInterface(XFrame.class, oFrame);
xFrame.setName("ObjectInspector");
xFrame.initialize(xWindow);
XFramesSupplier xFramesSup = (XFramesSupplier) UnoRuntime.queryInterface(XFramesSupplier.class, StarDesktop);
XFrames xFrames = xFramesSup.getFrames();
xFrames.append(xFrame);
log.println("attach ObjectInspector to floating frame...");
XInitialization xOII = (XInitialization) UnoRuntime.queryInterface(XInitialization.class, xInspectorModel);
xOII.initialize(new Object[0]);
xInspector.setInspectorModel(xInspectorModel);
// for debug purposes the following lines could commented out. But in
// this case the com.sun.star.frame.XController would be failed!
//xInspector.attachFrame(xFrame);
//xWindow.setVisible(true);