else if (Application.IS_MAC) {
try {
Process proc = Runtime.getRuntime().exec("/usr/bin/open " + link); //$NON-NLS-1$
/* Let StreamGobbler handle error message */
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream());
/* Let StreamGobbler handle output */
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream());
/* Flush both error and output streams */
errorGobbler.schedule();
outputGobbler.schedule();
}
/* Show error message, default browser could not be launched */
catch (IOException e) {
Activator.getDefault().logError(e.getMessage(), e);
showErrorIfExternalBrowserFails(null);
}
}
/* Launch default browser on Linux & Solaris */
else {
/* Run browser in a seperate thread */
Thread launcher = new Thread("") { //$NON-NLS-1$
@Override
public void run() {
try {
/* Return early if shutting down */
if (Controller.getDefault().isShuttingDown())
return;
/* The default browser was successfully launched once, use again */
if (fgWebBrowserSuccessfullyOpened) {
Process proc = Runtime.getRuntime().exec(fgWebBrowser + " -remote openURL(" + link + ")"); //$NON-NLS-1$ //$NON-NLS-2$
/* Let StreamGobbler handle error message */
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream());
/* Let StreamGobbler handle output */
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream());
/* Flush both error and output streams */
errorGobbler.schedule();
outputGobbler.schedule();
}
/* The default browser was not yet launched, try NS and Mozilla */
else {
Process proc = openWebBrowser(link);
fgWebBrowserSuccessfullyOpened = true;
if (proc != null) {
/* Let StreamGobbler handle error message */
StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream());
/* Let StreamGobbler handle output */
StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream());
/* Flush both error and output streams */
errorGobbler.schedule();
outputGobbler.schedule();
}
/* Wait for this process */
try {
if (proc != null)