Hi Andreas, On Sat, Sep 22, 2007 at 10:12:50PM +0200, Andreas Schneider wrote: > my extension displays a dialog when certain Calc cells are > double-clicked (which now works, thanks to the great support here :)). > There should be no other interaction with the spreadsheet during this > dialog is shown, so a modal JDialog comes to mind. That would require me > to provide a java.awt.Frame as parent so that OOo doesn't completely > freeze as well as the dialog staying on top within the application > context (and not on top of ALL windows). > I'm currently a bit stuck with this. There has been a similar request on > the oooforums.org, but that has been (more or less) unanswered. > I know about the XSystemDependentWindowPeer interface which should be > able to "[Return] a global reference to a java.awt.Component object > provided from the JNI-API" but on the one hand I don't think that I > could simply get a java.awt.Frame out of that Component and on the other > hand the "com.sun.star.frame.Desktop" doesn't provide this interface. > > 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 don't have an answer to your questions. But here is another approach that may work for you. The Java API contains a class called javax.swing.PopupFactory which allows you to register and show JPanels as popups. Basically you request an instance of the currently used PopupFactory and then connect the JPanel that should be visible as popup to an instance of Component. JComponent is a subclass of Component so you should be able to connect the Popup to your OOo instance. Please see the API docs for PopupFactory for more details. And please let me know if you have any questions about this. HTH, Wouter -- 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]
