/[svn]/jsampler/trunk/src/org/jsampler/view/std/StdUtils.java
ViewVC logotype

Diff of /jsampler/trunk/src/org/jsampler/view/std/StdUtils.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1495 by iliev, Tue Aug 28 17:00:19 2007 UTC revision 1496 by iliev, Mon Nov 19 22:22:22 2007 UTC
# Line 21  Line 21 
21   */   */
22  package org.jsampler.view.std;  package org.jsampler.view.std;
23    
24    import java.awt.Desktop;
25    
26    import java.net.URI;
27    
28  import java.util.Vector;  import java.util.Vector;
29    
30  import org.jsampler.CC;  import org.jsampler.CC;
31    import org.jsampler.HF;
32  import org.jsampler.JSPrefs;  import org.jsampler.JSPrefs;
33    
34    import static org.jsampler.view.std.StdI18n.i18n;
35    
36    
37  /**  /**
38   *   *
# Line 57  public class StdUtils { Line 64  public class StdUtils {
64                  elements = v.toArray(new String[v.size()]);                  elements = v.toArray(new String[v.size()]);
65                  preferences().setStringListProperty(property, elements);                  preferences().setStringListProperty(property, elements);
66          }          }
67            
68            public static boolean
69            checkDesktopSupported() {
70                    if(Desktop.isDesktopSupported()) return true;
71                    
72                    String s = i18n.getError("StdUtils.DesktopApiNotSupported");
73                    HF.showErrorMessage(s, CC.getMainFrame());
74                    
75                    return false;
76            }
77            
78            public static void
79            browse(String uri) {
80                    if(!checkDesktopSupported()) return;
81                    
82                    try { Desktop.getDesktop().browse(new URI(uri)); }
83                    catch(Exception x) { x.printStackTrace(); }
84            }
85            
86            public static void
87            mail(String uri) {
88                    if(!StdUtils.checkDesktopSupported()) return;
89                    
90                    Desktop desktop = Desktop.getDesktop();
91                    
92                    try { Desktop.getDesktop().mail(new URI(uri)); }
93                    catch(Exception x) { x.printStackTrace(); }
94            }
95  }  }

Legend:
Removed from v.1495  
changed lines
  Added in v.1496

  ViewVC Help
Powered by ViewVC