Changeset 149 in josm for src/org/openstreetmap/josm/tools
- Timestamp:
- 2006-10-05T22:33:21+02:00 (19 years ago)
- Location:
- src/org/openstreetmap/josm/tools
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
r113 r149 21 21 22 22 import org.openstreetmap.josm.Main; 23 import org.openstreetmap.josm.plugins.PluginException; 24 import org.openstreetmap.josm.plugins.PluginProxy; 23 25 24 26 /** … … 35 37 JOptionPane.showMessageDialog(Main.parent, "You are out of memory. Strange things may happen.\nPlease restart JOSM and load smaller data sets."); 36 38 return; 39 } 40 41 if (e instanceof PluginException) { 42 PluginProxy plugin = ((PluginException)e).getPlugin(); 43 if (plugin != null && !plugin.misbehaving) { 44 JOptionPane.showMessageDialog(Main.parent, tr("The plugin {0} throwed an exception: {1}\nIt may be outdated. Please contact the plugin's autor.\nThis message will not shown again until JOSM is restarted.", plugin.name, e.getMessage())); 45 plugin.misbehaving = true; 46 return; 47 } 37 48 } 38 49 -
src/org/openstreetmap/josm/tools/OpenBrowser.java
r69 r149 14 14 public static String displayUrl(String url) { 15 15 String os = System.getProperty("os.name"); 16 if (os == null) 17 return "unknown operating system"; 16 18 try { 17 19 if (os != null && os.startsWith("Windows")) 18 Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); 19 else { 20 //... 21 } 20 windows(url); 21 else if (os.equals("Linux") || os.equals("Solaris") || os.equals("SunOS") || os.equals("AIX") || os.equals("FreeBSD")) 22 linux(url); 23 else if (os.equals("Mac OS") || os.equals("Mac OS X")) 24 mac(url); 25 else 26 return "unknown operating system"; 22 27 } catch (IOException e) { 23 28 return e.getMessage(); … … 25 30 return null; 26 31 } 32 33 private static void windows(String url) throws IOException { 34 Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); 35 } 36 37 private static void linux(String url) throws IOException { 38 try { 39 Runtime.getRuntime().exec("gnome-open " + url); 40 } catch (IOException e) { 41 Runtime.getRuntime().exec("kfmclient openURL " + url); 42 } 43 } 44 45 private static void mac(String url) throws IOException { 46 Runtime.getRuntime().exec("open " + url); 47 } 27 48 } -
src/org/openstreetmap/josm/tools/UrlLabel.java
r104 r149 14 14 15 15 public UrlLabel(String url) { 16 this (url, url); 17 } 18 19 public UrlLabel(String url, String description) { 16 20 this.url = url; 17 21 setContentType("text/html"); 18 setText("<html><a href=\""+url+"\">"+ url+"</a></html>");22 setText("<html><a href=\""+url+"\">"+description+"</a></html>"); 19 23 setEditable(false); 20 24 setOpaque(false);
Note:
See TracChangeset
for help on using the changeset viewer.