diff options
author | Damian Minkov <damencho@jitsi.org> | 2010-12-10 12:00:18 +0000 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2010-12-10 12:00:18 +0000 |
commit | d016f4fd6dfa2c61f38203a1ef3185b3ff6eccdb (patch) | |
tree | c515dd349d6075eff7041398be438dcae705f7e9 | |
parent | d9caae312f25ab9065e321495f213527566f9c0b (diff) | |
download | jitsi-d016f4fd6dfa2c61f38203a1ef3185b3ff6eccdb.zip jitsi-d016f4fd6dfa2c61f38203a1ef3185b3ff6eccdb.tar.gz jitsi-d016f4fd6dfa2c61f38203a1ef3185b3ff6eccdb.tar.bz2 |
Mac uri handler using new java api.
-rw-r--r-- | lib/os-specific/mac/OrangeExtensions.jar | bin | 8934 -> 22407 bytes | |||
-rw-r--r-- | src/net/java/sip/communicator/impl/argdelegation/ArgDelegationActivator.java | 31 |
2 files changed, 23 insertions, 8 deletions
diff --git a/lib/os-specific/mac/OrangeExtensions.jar b/lib/os-specific/mac/OrangeExtensions.jar Binary files differindex 7144908..74ca133 100644 --- a/lib/os-specific/mac/OrangeExtensions.jar +++ b/lib/os-specific/mac/OrangeExtensions.jar diff --git a/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationActivator.java b/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationActivator.java index 1bfd6b0..1ca2727 100644 --- a/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationActivator.java +++ b/src/net/java/sip/communicator/impl/argdelegation/ArgDelegationActivator.java @@ -12,9 +12,10 @@ import net.java.sip.communicator.util.launchutils.*; import org.osgi.framework.*; -//import com.apple.eawt.AppEvent.*; import com.apple.eawt.*; +import java.lang.reflect.*; + /** * Activates the <tt>ArgDelegationService</tt> and registers a URI delegation * peer with the util package arg manager so that we would be notified when the @@ -65,13 +66,27 @@ public class ArgDelegationActivator if(application != null) { -// application.setOpenURIHandler(new OpenURIHandler() { -// -// public void openURI(OpenURIEvent evt) -// { -// delegationPeer.handleUri(evt.getURI().toString()); -// } -// }); + // if this fails its most probably cause using older java than + // 10.6 Update 3 and 10.5 Update 8 + // and older native method for registering uri handlers + // should be working + try + { + Method method = application.getClass() + .getMethod("setOpenURIHandler", OpenURIHandler.class); + + OpenURIHandler handler = new OpenURIHandler() { + public void openURI( + com.apple.eawt.AppEvent.OpenURIEvent evt) + { + delegationPeer.handleUri(evt.getURI().toString()); + } + }; + + method.invoke(application, handler); + } + catch(Throwable ex) + {} } } } |