1 19 20 package org.netbeans.modules.extbrowser; 21 22 import org.openide.ErrorManager; 23 import org.openide.awt.HtmlBrowser; 24 import org.openide.execution.NbProcessDescriptor; 25 import org.openide.util.NbBundle; 26 import org.openide.util.Utilities; 27 28 31 public class IExplorerBrowser extends ExtWebBrowser { 32 33 36 40 public static Boolean isHidden () { 41 return (Utilities.isWindows()) ? Boolean.FALSE : Boolean.TRUE; 42 } 43 44 private static final long serialVersionUID = 6433332055280422486L; 45 46 47 public IExplorerBrowser() { 48 ddeServer = ExtWebBrowser.IEXPLORE; 49 } 50 51 54 public String getName () { 55 if (name == null) { 56 this.name = NbBundle.getMessage(IExplorerBrowser.class, "CTL_IExplorerBrowserName"); 57 } 58 return name; 59 } 60 61 66 public HtmlBrowser.Impl createHtmlBrowserImpl() { 67 ExtBrowserImpl impl = null; 68 69 if (org.openide.util.Utilities.isWindows ()) { 70 impl = new NbDdeBrowserImpl (this); 71 } else { 72 throw new UnsupportedOperationException (NbBundle.getMessage (IExplorerBrowser.class, "MSG_CannotUseBrowser")); 73 } 74 75 return impl; 76 } 77 78 83 protected NbProcessDescriptor defaultBrowserExecutable () { 84 String b; 85 String params = "-nohome "; 87 params += "{" + ExtWebBrowser.UnixBrowserFormat.TAG_URL + "}"; 88 try { 89 b = NbDdeBrowserImpl.getBrowserPath(getDDEServer ()); 90 } catch (NbBrowserException e) { 91 b = "C:\\Program Files\\Internet Explorer\\iexplore.exe"; } catch (UnsatisfiedLinkError e) { 93 b = "iexplore"; } 96 if (ExtWebBrowser.getEM().isLoggable(ErrorManager.INFORMATIONAL)) { 97 ExtWebBrowser.getEM().log(ErrorManager.INFORMATIONAL, "" + System.currentTimeMillis() + " IE: defaultBrowserExecutable: " + params + ", " + b); 98 } 99 return new NbProcessDescriptor (b, params); 100 } 101 102 private void readObject (java.io.ObjectInputStream ois) throws java.io.IOException , ClassNotFoundException { 103 ois.defaultReadObject(); 104 } 105 106 107 } 108 | Popular Tags |