launch a browser for mac - work in progress

cusax-fix
Yana Stamcheva 19 years ago
parent 5d95a3eec1
commit 0e2d028092

@ -21,7 +21,7 @@
<property name="test.html.reports.dir" value="${test.reports.dir}/html"/>
<property name="release" value="release"/>
<property name="inst.resrc" value="resources/install"/>
<!-- Put here the release directory -->
<property name="macosx.app.dir" value="${release}/macosx"/>
<!-- Put here the Application name -->
@ -448,6 +448,9 @@
<!-- Tell java.util.logging about our logging preferences -->
<sysproperty key="java.util.logging.config.file"
value="lib/logging.properties"/>
<sysproperty key="java.library.path"
value="${lib}/native/x86"/>
</java>
</target>
@ -795,6 +798,8 @@ javax.swing.event, javax.swing.border"/>
prefix="net/java/sip/communicator/service/gui"/>
<zipfileset dir="${dest}/net/java/sip/communicator/impl/gui"
prefix="net/java/sip/communicator/impl/gui"/>
<zipfileset src="${lib}/BrowserLauncher2-10rc4.jar"
prefix=""/>
</jar>
</target>
@ -830,4 +835,16 @@ javax.swing.event, javax.swing.border"/>
</jar>
</target>
<!-- BUNDLE-PLUGIN-SYSTRAY -->
<!--target name="bundle-plugin-systray">
<jar compress="false" destfile="${bundles.dest}/systray.jar"
manifest="src/net/java/sip/communicator/plugin/systray/systray.manifest.mf">
<zipfileset dir="${dest}/net/java/sip/communicator/plugin/systray"
prefix="net/java/sip/communicator/plugin/systray"/>
<zipfileset src="${lib}/jdic/jdic.jar" prefix=""/>
<zipfileset dir="${lib}/jdic" prefix=""/>
<zipfileset src="${lib}/jdic/linux/jdic_stub.jar" prefix=""/>
</jar>
</target-->
</project>

Binary file not shown.

@ -6,13 +6,10 @@
*/
package net.java.sip.communicator.impl.gui.utils;
/*
* The content of this file was based on code borrowed from
* http://www.centerkey.com/.
*/
import java.lang.reflect.Method;
import javax.swing.JOptionPane;
import edu.stanford.ejalbert.BrowserLauncherRunner;
import edu.stanford.ejalbert.exception.BrowserLaunchingInitializingException;
import edu.stanford.ejalbert.exception.UnsupportedOperatingSystemException;
import net.java.sip.communicator.impl.gui.i18n.Messages;
@ -24,8 +21,8 @@
*/
public class BrowserLauncher {
private static final String errMsg
= Messages.getString("launchBrowserError");
//private static final String errMsg
// = Messages.getString("launchBrowserError");
/**
* Launches a browser for the given url, depending on the operation system
@ -34,6 +31,23 @@ public class BrowserLauncher {
* @param url The url to open in the browser.
*/
public static void openURL(String url) {
edu.stanford.ejalbert.BrowserLauncher launcher;
try {
launcher = new edu.stanford.ejalbert.BrowserLauncher(null);
BrowserLauncherRunner runner = new BrowserLauncherRunner(launcher, url, null);
Thread launcherThread = new Thread(runner);
launcherThread.start();
}
catch (BrowserLaunchingInitializingException e) {
e.printStackTrace();
}
catch (UnsupportedOperatingSystemException e) {
e.printStackTrace();
}
/*
String osName = System.getProperty("os.name");
try {
if (osName.startsWith("Mac OS")) {
@ -64,6 +78,6 @@ else if (osName.startsWith("Windows"))
JOptionPane.showMessageDialog(null, errMsg + ":\n"
+ e.getLocalizedMessage());
}
*/
}
}

Loading…
Cancel
Save