Andreas Schneider escribió:
Hi,
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).
Thanks in advance,
Andreas.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I'm not sure if it is possible to integrate a Java window into OOo
windowing system. On the contrary, the integration of OpenOffice.org
windows into Java windows (more precise a Java bean environment) is
documented in the Developer's Guide:
http://api.openoffice.org/docs/DevelopersGuide/OfficeDev/OfficeDev.xhtml#1_1_7_Java_Window_Integration
if reading this you get how to set an OOo window (the component's
container window) as parent of a Java frame, well... congratulation and
share it with us! For what I've seen, nobody has done it: just test the
Java extension using swing (for example the Object Inspector and
LanguageTool): all dialogs are non-modal, because modality requires a
Java frame as parent window. And if you test it, you will see how
horrible is the result: the Java window may be executed but never shown
on top of the other windows...
I've found no other solution than this: I only use Java windows for top
JFrames (if the window isn't shown to the user, at least it isn't lost
behind all the other open wins., because the user can check in the task
bar that the exists another window).
For modality, use OOo AWT... yes, I agree.... compared to Java swing...
but I've found no other solution.
Bye and luck with that.
Ariel.
--
Ariel Constenla-Haile
La Plata, Argentina
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.arielconstenlahaile.com.ar/ooo/
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]