diff options
Diffstat (limited to 'libjava/classpath/gnu/java/awt/peer/GnomeDesktopPeer.java')
-rw-r--r-- | libjava/classpath/gnu/java/awt/peer/GnomeDesktopPeer.java | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/libjava/classpath/gnu/java/awt/peer/GnomeDesktopPeer.java b/libjava/classpath/gnu/java/awt/peer/GnomeDesktopPeer.java index cc41f749dc0..2347371adf2 100644 --- a/libjava/classpath/gnu/java/awt/peer/GnomeDesktopPeer.java +++ b/libjava/classpath/gnu/java/awt/peer/GnomeDesktopPeer.java @@ -60,13 +60,13 @@ public class GnomeDesktopPeer { // check if a command already exists String command = super.getCommand(action); - + if (command == null) { try { if (action == _BROWSE) - { + { command = execQuery(BROWSER_QUERY_GNOME); } else if (action == _PRINT) @@ -83,46 +83,46 @@ public class GnomeDesktopPeer command = null; } } - + return command; } - + public void browse(URI url) throws IOException { checkPermissions(); - + String browser = getCommand(_BROWSE); - + if (browser == null) throw new UnsupportedOperationException(); - + browser = browser + " " + url.toString(); - + Runtime.getRuntime().exec(browser); } protected boolean supportCommand(String check) { if (check == _PRINT) - { + { return super.supportCommand(check); } - + return true; } public void mail() throws IOException { checkPermissions(); - + String mail = getCommand(_MAIL); - + if (mail == null) throw new UnsupportedOperationException(); - + Runtime.getRuntime().exec(mail + " mailto:"); } - + protected String execQuery(String command) throws IOException { InputStream in = null; @@ -149,7 +149,7 @@ public class GnomeDesktopPeer // remove %s from the string, leave only the command line int index = output.indexOf("%s"); output.delete(index, index + 1); - + return output.toString().trim(); } } |