1 19 20 package org.netbeans.modules.extbrowser; 21 22 import java.beans.*; 23 import java.util.HashMap ; 24 25 import org.openide.awt.HtmlBrowser; 26 import org.openide.execution.NbProcessDescriptor; 27 import org.openide.util.NbBundle; 28 29 import org.openide.util.Utilities; 30 31 36 public class SimpleExtBrowser extends ExtWebBrowser { 37 38 private static final long serialVersionUID = -8494345762328555637L; 39 40 44 public static Boolean isHidden () { 45 return Boolean.valueOf(Utilities.isWindows() || (Utilities.isUnix() && !Utilities.isMac())); 46 } 47 48 49 public SimpleExtBrowser() { 50 super(); 51 if (Utilities.getOperatingSystem () == Utilities.OS_OS2) { 52 browserExecutable = new NbProcessDescriptor( 53 "Netscape.exe", " {" + BrowserFormat.TAG_URL + "}", NbBundle.getBundle(SimpleExtBrowser.class).getString("MSG_BrowserExecutorHint") 57 ); 58 } else if (Utilities.isMac()) { 59 browserExecutable = new NbProcessDescriptor( 60 "/usr/bin/open", " {" + BrowserFormat.TAG_URL + "}", NbBundle.getBundle(SimpleExtBrowser.class).getString("MSG_BrowserExecutorHint") 64 ); 65 } else { 66 browserExecutable = new NbProcessDescriptor( 67 "", " {" + BrowserFormat.TAG_URL + "}", NbBundle.getBundle(SimpleExtBrowser.class).getString("MSG_BrowserExecutorHint") 72 ); 73 } 74 } 75 76 79 public String getName() { 80 if (name == null) { 81 this.name = NbBundle.getMessage(SimpleExtBrowser.class, "CTL_SimpleExtBrowser"); 82 } 83 return name; 84 } 85 86 90 public HtmlBrowser.Impl createHtmlBrowserImpl() { 91 return new SimpleExtBrowserImpl(this); 92 } 93 94 96 public static class BrowserFormat extends org.openide.util.MapFormat { 97 98 private static final long serialVersionUID = 5990981835151848381L; 99 100 public static final String TAG_URL = "URL"; 102 103 109 public BrowserFormat (String url) { 110 super(new HashMap ()); 111 java.util.Map map = getMap (); 112 113 map.put (TAG_URL, url); 114 } 115 116 } 117 } 118 | Popular Tags |