diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:36 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-23 16:59:36 +0100 |
commit | 11cdc4ccc4ae58437ded5aef40df1276220edc2c (patch) | |
tree | 7e367cf5e21e93532d69126eadac3090e1d33a1a /odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java | |
parent | f03de39457c663e88592899ebda0f07c4e24aa9c (diff) | |
parent | 33e2b11638c87ffed5d91405ba76cb00cd91e1be (diff) |
Merge commit 'ooo/DEV300_m103'
Conflicts:
odk/examples/DevelopersGuide/Components/CppComponent/service1_impl.cxx
odk/examples/DevelopersGuide/Database/DriverSkeleton/SServices.cxx
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilterDetection/fdcomp.cxx
odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
odk/examples/cpp/complextoolbarcontrols/exports.cxx
odk/examples/cpp/counter/countermain.cxx
odk/examples/cpp/remoteclient/remoteclient.cxx
odk/settings/settings.mk
Diffstat (limited to 'odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java')
-rw-r--r-- | odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java index 14c2659e48a7..790a52d46fb1 100644 --- a/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java +++ b/odk/examples/DevelopersGuide/Components/Addons/JobsAddon/AsyncJob.java @@ -312,7 +312,22 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob // Because we need a parent anytime. // And showing e.g. a java dialog can make some trouble // inside office ... but we have no chance here. - javax.swing.JOptionPane.showMessageDialog(null, sMessage, sTitle, javax.swing.JOptionPane.INFORMATION_MESSAGE); + final java.lang.String sFinalTitle = sTitle; + final java.lang.String sFinalMessage = sMessage; + + // On Mac OS X, AWT/Swing must not be accessed from the AppKit thread, so call + // SwingUtilities.invokeLater always on a fresh thread to avoid that problem + // (also, the current thread must not wait for that fresh thread to terminate, + // as that would cause a deadlock if this thread is the AppKit thread): + final Runnable doRun = new Runnable() { + public void run() { + javax.swing.JOptionPane.showMessageDialog(null, sFinalMessage, sFinalTitle, javax.swing.JOptionPane.INFORMATION_MESSAGE); + } + }; + + new Thread( doRun ) { + public void run() { javax.swing.SwingUtilities.invokeLater(doRun); } + }.start(); } //___________________________________________ @@ -415,12 +430,15 @@ public class AsyncJob extends WeakBase implements XServiceInfo, XAsyncJob } //___________________________________________ - - public synchronized static boolean __writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey xRegKey) - { - return Factory.writeRegistryServiceInfo( - AsyncJob.IMPLEMENTATIONNAME, - AsyncJob.SERVICENAMES, - xRegKey); - } + // This method not longer necessary since OOo 3.4 where the component registration + // was changed to passive component registration. For more details see + // http://wiki.services.openoffice.org/wiki/Passive_Component_Registration + +// public synchronized static boolean __writeRegistryServiceInfo(com.sun.star.registry.XRegistryKey xRegKey) +// { +// return Factory.writeRegistryServiceInfo( +// AsyncJob.IMPLEMENTATIONNAME, +// AsyncJob.SERVICENAMES, +// xRegKey); +// } } |