Re: [api-dev] Modal Swing JDialog
Andreas Schneider wrote: So I have two questions: does OOo somehow provide a java.awt.Frame I can use as parent? If not: is there a (prefered) way I can manually lock OOo and implement its main loop? That way I could lock it, show the JDialog modal in its own thread and while the thread is alive process OOs main loop. When the thread ends, that loop is left, my code proceeds and OOo can regain control. (I hope you know what I mean, it's been a bit hard to describe). I'm not aware of any wa to provide a java.awt.Frame but there is a hack that can help you: when you start your Java dialog also create a 1 pixel big dialog created by UNO AWT (with the parent of your choice). This will lock OOo's API sufficiently. Once your dialog is closed also close the invisible UNO AWT dialog. Ciao, Mathias -- Mathias Bauer (mba) - Project Lead OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS Please don't reply to [EMAIL PROTECTED]. I use it for the OOo lists and only rarely read other mails sent to it. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Modal Swing JDialog
Mathias Bauer skrev: Andreas Schneider wrote: So I have two questions: does OOo somehow provide a java.awt.Frame I can use as parent? If not: is there a (prefered) way I can manually lock OOo and implement its main loop? That way I could lock it, show the JDialog modal in its own thread and while the thread is alive process OOs main loop. When the thread ends, that loop is left, my code proceeds and OOo can regain control. (I hope you know what I mean, it's been a bit hard to describe). I'm not aware of any wa to provide a java.awt.Frame but there is a hack that can help you: when you start your Java dialog also create a 1 pixel big dialog created by UNO AWT (with the parent of your choice). This will lock OOo's API sufficiently. Once your dialog is closed also close the invisible UNO AWT dialog. I'm interested a bit in how to do this, are there any examples on the net you can point to? -- Christian Andersson - [EMAIL PROTECTED] Configuration and Collaboration for OpenOffice.org Open Framework Systems AS http://www.ofs.no - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Modal Swing JDialog
Christian Andersson wrote: I'm interested a bit in how to do this, are there any examples on the net you can point to? I just implemented it that way: public void showModal(javax.swing.JDialog dialog) { try { Object tempDialogModel = multiComponentFactory.createInstanceWithContext(com.sun.star.awt.UnoControlDialogModel, context); XPropertySet properties = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, tempDialogModel); properties.setPropertyValue(PositionX, new Integer(0)); properties.setPropertyValue(PositionY, new Integer(0)); properties.setPropertyValue(Width, new Integer(1)); properties.setPropertyValue(Height, new Integer(1)); final Object tempDialog = multiComponentFactory.createInstanceWithContext(com.sun.star.awt.UnoControlDialog, context); XControl xControl = (XControl) UnoRuntime.queryInterface(XControl.class, tempDialog); XControlModel xControlModel = (XControlModel) UnoRuntime.queryInterface(XControlModel.class, tempDialogModel); xControl.setModel(xControlModel); Object toolkit = multiComponentFactory.createInstanceWithContext(com.sun.star.awt.Toolkit, context); XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, toolkit); XWindow xWindow = (XWindow) UnoRuntime.queryInterface(XWindow.class, xControl); xWindow.setVisible(false); xControl.createPeer(xToolkit, null); final XDialog xTempDialog = (XDialog) UnoRuntime.queryInterface(XDialog.class, tempDialog); dialog.addWindowListener(new WindowAdapter() { public void windowClosed(WindowEvent e) { xTempDialog.endExecute(); XComponent component = (XComponent) UnoRuntime.queryInterface(XComponent.class, tempDialog); component.dispose(); } }); dialog.setVisible(true); xTempDialog.execute(); } catch (com.sun.star.uno.Exception ex) { ex.printStackTrace(); } } But in my case that small dialog is still visible and considerably larger than 1 pixel. I will try if I can somehow get it off-screen or really invisible (but still modal). If you find something out, please inform me. Thanks Mathias for that hint. It's at least a good point to start from :-) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] base snippets
Thanks integrated into snippet collection. Tom Marc Santhoff schrieb: Hi, I finally got the snippet creator working, so here are two snippets for the collection. Marc - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Document reflow and updating the ToC
Hi Sander, On 09/19/07 11:00, Sander Marechal wrote: Is there a way to force a reflow through the Python Uno API? Or is there a way to get notified when OOo has finished reflowing and laying out the document, so I can wait for it? the document implements the XRefreshable interface which offers a refresh() function. This triggers the formatting of the document. Hope this helps, Frank -- Frank Meies (fme) - OpenOffice.org Writer OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Registration of UNO package via Java possible?
Hi Tobias, [...] I tried to implement it and it seems to work partly. I can remove already registered components successfully. Very good! But I have problems registering my Extension. Registering it manually works great, thus I know the Extension is fine, although its an old extension (.uno.pkg). My code seems also to find the package, because passing the wrong path returns a worse error message. Here is the error message: -%- com.sun.star.deployment.DeploymentException: Fehler beim Hinzufügen von: JudasComponent.und.pkg Are you sure it is .und.pkg above ('d' instead of 'o' in .uno.pkg)? -%- Fehler beim Hinzufügen von is German and means Failure when adding Not sure why that happens (I *think* this behaviour may have started with 2.2, as it used to work flawlessly beforehand). [It would be nice if at that point OOo would give a much more meaningful error message!] Here ist the code: -% String packageURL = /home/tobias/workspace/OOComNG/oocom/unopkg/JudasComponent.uno.pkg; //Creating a UNO compatible File URL String packageUNOURL = OODocument.createUNOFileURL(packageURL); String mediaType = application/vnd.sun.star.uno-component;type=Java; // Use String vnd.sun.star.tdoc:///4711/uno_packages for transient, // user for local, shared for global package installation XPackageManager xPM = getPackageManager(user); try { xPM.addPackage(packageUNOURL, mediaType, null, null); } catch (Exception e) { System.out.println(e); } -% I think the mediaType is wrong. But what media type should I use to add a complete Extension Package? I tried adding the jar file contained in the package, but I got the same error... Hmm, mostlikely the media-type is o.k., eg. cf. http://wiki.services.openoffice.org/wiki/General_UNO_Component_Project_Type. Maybe someone can help me... Maybe the addPackage() method got changed, such that the last two arguments need to be supplied and not be null? (Just a wild guess.) ---rony - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Re: paragraph enumeration causes mysterious cursor movement....
ashok _ wrote: Hello Zbigniew: On 9/20/07, Zbigniew Banach wrote: ashok _ napisał(a): Well, I don't know if that's what you need, but I've just recently found out you can enumerate the content of the text range. This will give you an enumeration of paragraphs, and for each paragraph you can enumerate portions, whose strings you can then concatenate to get the full string of the range. See Noelson Duarte's 19.09 reply to my own question for a code sample. That sounds like a reasonable alternative... thanks, I ll give it a try. but only a workaround, you should definitely submit an issue for this problem. Juergen ashok - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Hyperlink in Table of content always throwing IllegalArgumentException, plz help
Sandeep Raghuvanshi wrote: Thank you very much Bernard for the solution in the forum: http://www.oooforum.org/forum/viewtopic.phtml?t=11415 The only change I discovered was that we have to use one set of square bracket as TOC is Array of Array of PropertyValue Now I have another problem(sorry guys but the solution has to work in MS Word also) When I convert this document to MS Word format, all of the hyperlinks are pointing to the first page of the document instead of the actual page number. Any idea about this strange behavior? Is this an issue with the OpenOffice and the document is valid when loading it in OO.org, right? If yes i would assume that it is no problem with the API. Have you tried to create a simple document with a TOC with links via the UI and have you export it then? Juergen API? Please guide, thanks regards, Sandeep On 9/21/07, Sandeep Raghuvanshi [EMAIL PROTECTED] wrote: Thanks Bernard, May be by looking at the error message you get some idea: *Error: [automation bridge] unexpected exception in UnoConversionUtilitiesT::convertValueObject ! Message : [automation bridge]UnoConversionUtilitiesT::createOleObjectWrapper The variant does not contain an object type! * Thanks for the help so far, regards, Sandeep On 9/21/07, Bernard Marcelly [EMAIL PROTECTED] wrote: Message de Sandeep Raghuvanshi date 2007-09-21 09:07 : Hi Bernard, Thank you for your kind response. I have tried the logic suggested by you but still there is an automation error getting generated when I tried to update the TOC. Here is my modified code and the error screen shot is attached: The screenshot was discarded by the mailing list. You should have described the error message. I have no knowledge about ToC handling. Sorry I can't help more. __ Bernard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] AWT TREE: OOoBasic version of the ScriptSelector example
Frank Schönheit - Sun Microsystems Germany wrote: Hi Bernard, I don't want to start a troll, but the service com.sun.star.sheet.Spreadsheet is _unpublished_ since a long time, see http://api.openoffice.org/docs/common/ref/com/sun/star/sheet/Spreadsheet.html Hmm, okay, and what does this tell us? i would say that it is more a bug because this service is really old, isn't it. The change mentioned by Christian would be of course a valid change and fits in the current existing definition of published/unpublished API's. The concept of unpublished was introduced for cases such as the Childs/Children: The interface has a flaw, which can be fixed easily, and does not require substantial effort for the clients if fixed. I much prefer doing this small innocent fix for the next release, at the cost of some scripts to be adjusted, over being annoying by the current spelling error for the next *years* (finally, it looks somewhat unprofessional, doesn't it?). Yes, we don't have a mechanism in place which ensures that APIs become published after a while, which leads to APIs such as the one you mentioned. On the other hand, I doubt that anybody will do a severe incompatible change to Spreadsheet or Shape, I think people are responsible enough to recognize that this would be a bad idea, after the API has been there for years. but of course we strongly recommend that API's that are introduced to be used by clients ... should be published after 2-3 releases. Ok, we have also no clear concept for private API's which results in some types that are more or less private and that will remain as unpublished. But anyway it should be a minority. On yet another hand, I personally would not like to declare any service as published as long as this forbids even minor and innocent changes which do not cause any trouble to any client, but that's another story which I perhaps should not start again, here :-\ thanks, but you should sometimes switch the glasses and should take a look on the whole thing from a user perspective. We have both users and developers and from a user perspective it is a cool feature to have compatible API's. And please don't misunderstand me i can also understand our developers and that is the reason why we again try to find a working or practicable compromise. Anyway it is on my todo wish list to check frequently our unpublished API's and i will ask for reasons why they are not published or why they should be remain unpublished ;-) Juergen Ciao Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Basic ID opens after closing Dialog
resolved Helge, found out that disposing is also a method who needs a callback sub this mylistener_disposing was missing 2 times who invoces with a open IDE 2 non dedicated error messages or the unwantedo pening off off the basicIDE (when this was closed thanks again Fernand Helge Kraak wrote: Hi Fernand, in my case it was a code mistake caused by myself. Please look again at the issue I linked to and read Frank Schönheits comment. Maybe you made the same mistake. Best Helge -- Helge Kraak Frauenlobstr. 78a 60487 Frankfurt am Main Germany Mobil: +49 (0)178 828 80 90 Telefon:+49 (0)69 979 466 23 VoIP (SIP): [EMAIL PROTECTED] Fax:+49 (0)32 22 11 64 788 Email: [EMAIL PROTECTED] / [EMAIL PROTECTED] Internet: www.helge.kraak.info Am 14.09.2007 um 09:15 schrieb Fernand Vanrie: Helge, Thanks for this information, my problems ar cenrtenlay related to listeners who arent properly removed I do futher test en come backs with the results Fernand Helge Kraak wrote: Please have look on this issue. Maybe you can file another issue with your procedure and link to this one: http://qa.openoffice.org/issues/show_bug.cgi?id=81071 Helge --Helge Kraak Frauenlobstr. 78a 60487 Frankfurt am Main Germany Mobil: +49 (0)178 828 80 90 Telefon:+49 (0)69 979 466 23 VoIP (SIP): [EMAIL PROTECTED] Fax:+49 (0)32 22 11 64 788 Email: [EMAIL PROTECTED] / [EMAIL PROTECTED] Internet: www.helge.kraak.info Am 13.09.2007 um 18:17 schrieb Fernand Vanrie: I have a very complex procedure using a Dialog with listeners and a peer window for showing pictures for a on nown reason, (was not happening befiore) when I close the dialog odialog.endexecute I get back at the piont where I started the Dialog (odialog.execute) but the oo-basic editor opens a empty basic edito screen and comes in front. of the document window in fact the same behaviour as I run into a basic-error but here no module is opened. When the basic ID is open nothing happens and the edito window stay behind the document window When using the set.visible method and disposing the dialog I do not have this behaviour. Any idea what can trigger this behaviour ? Fernand - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --Helge Kraak Frauenlobstr. 78a 60487 Frankfurt am Main Germany Mobil: +49 (0)178 828 80 90 Telefon:+49 (0)69 979 466 23 VoIP (SIP): [EMAIL PROTECTED] Fax:+49 (0)32 22 11 64 788 Email: [EMAIL PROTECTED] / [EMAIL PROTECTED] Internet: www.helge.kraak.info - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Hidden document Page style
Laurent Godard wrote: Hi all using OOoBasic if i modify the Standard pageStyle, the changes are taken into account only if the documebt has not been created in Hidden=true mode (eg. changing marges orientation) do you confirm ? NO, but what is the point of a page layout in hidden mode :-) Laurent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Hidden document Page style
On Mon, Sep 24, 2007 at 05:58:08PM +0200, Fernand Vanrie wrote: do you confirm ? NO, but what is the point of a page layout in hidden mode :-) There are LOTS of good reasons. Like printing, exporting to several formats or just to make sure it works. Anyway, I haven't tried this either... Wouter van Reeven -- People: If she weighs the same as a Duck, she's made of wood! Sir Bedevere: And therefore...? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [api-dev] Re: paragraph enumeration causes mysterious cursor movement....
On 9/24/07, Juergen Schmidt [EMAIL PROTECTED] wrote: ashok _ wrote: Hello Zbigniew: On 9/20/07, Zbigniew Banach wrote: ashok _ napisał(a): an enumeration of paragraphs, and for each paragraph you can enumerate portions, whose strings you can then concatenate to get the full string of the range. See Noelson Duarte's 19.09 reply to my own question for a code sample. That sounds like a reasonable alternative... thanks, I ll give it a try. but only a workaround, you should definitely submit an issue for this problem. have done so. http://www.openoffice.org/issues/show_bug.cgi?id=81697 Juergen