List Info

Thread: XComponentLoader event onload




XComponentLoader event onload
user name
2006-03-23 16:13:28

Hello,
I want to load and next update an ODT in a java program. To do that, i write this code :
        Object vDesktop = OoBootstrap.createDesktop();
           ; XComponentLoader vCompLoader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, vDesktop);

        String vUrl = "file://".concat(((File) pSrc).toURL().toExternalForm().substring(5));
           ; PropertyValue vProps[] = new PropertyValue[1];
           ; vProps[0] = new PropertyValue();
           ; vProps[0].Name = "Hidden";
           ; vProps[0].Value = Boolean.TRUE;
           ; Object vDocSrc = vCompLoader.loadComponentFromURL(vUrl, "_blank", 0, vProps);
           ;     
           ; XFrame  vFrameDoc = ((XModel) UnoRuntime.queryInterface(XModel.class, vDocSrc)).getCurrentController().getFrame();

           ; XDispatchHelper vDipatchHelper = (XDispatchHelper)UnoRuntime.queryInterface(XDispatchHelper.class, OoBootstrap.createService("com.sun.star.frame.DispatchHelper"));

           ; vDipatchHelper.executeDispatch((XDispatchProvider)UnoRuntime.queryInterface(XDispatchProvider.class, vFrameDoc), ".uno:UpdateAllIndexes";, "", 0, null);

In some big documents, this generate a crash of openOffice : i think that the document is not totaly load when "executeDispatch" is execute.

Can XComponentLoader generate an event when all the document is load?
Thank you.
Antoine POURCHEZ
antoine.pourchezkelis.fr

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )