aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/runtime
diff options
context:
space:
mode:
authorOmair Majid <[email protected]>2011-03-24 08:54:12 -0400
committerOmair Majid <[email protected]>2011-03-24 08:54:12 -0400
commitc92f8485eeea6af5b408c1b534e9ddd26f1e5547 (patch)
tree11f08f862608cd210681a54ca15a7652a05373e9 /netx/net/sourceforge/jnlp/runtime
parent3e70eb2b78afa1529bee6d3e03a60264ac5830c1 (diff)
Alternate means of finding browsers
This patch makes netx look for the users' default browser in this order: xdg-open, $BROWSER, and finally prompting the user for the command. To remain backwards compatible, this is only done if the user has not previously specified a default browser. 2011-03-24 Omair Majid <[email protected]> * netx/net/sourceforge/jnlp/resources/Messages.properties: Add RBrowserLocationPromptTitle, RBrowserLocationPromptMessage and RBrowserLocationPromptMessageWithReason. * netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java (isWindows): New method. Moved from XBasicService. (isUnix): New method. * netx/net/sourceforge/jnlp/services/XBasicService (initialize): Call initializeBrowserCommand. (initializeBrowserCommand): New method. (posixCommandExists): New method. (isWindows): Moved to JNLPRuntime.
Diffstat (limited to 'netx/net/sourceforge/jnlp/runtime')
-rw-r--r--netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
index 98bb6f5..f48d3ad 100644
--- a/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
+++ b/netx/net/sourceforge/jnlp/runtime/JNLPRuntime.java
@@ -620,6 +620,23 @@ public class JNLPRuntime {
}
}
+ /**
+ * @return true if running on Windows
+ */
+ public static boolean isWindows() {
+ String os = System.getProperty("os.name");
+ return (os != null && os.startsWith("Windows"));
+ }
+
+ /**
+ * @return true if running on a Unix or Unix-like system (including Linux
+ * and *BSD)
+ */
+ public static boolean isUnix() {
+ String sep = System.getProperty("file.separator");
+ return (sep != null && sep.equals("/"));
+ }
+
public static void setInitialArgments(List<String> args) {
checkInitialized();
SecurityManager securityManager = System.getSecurityManager();