1 19 20 package org.netbeans.modules.extbrowser; 21 22 import org.openide.util.Utilities; 23 import java.net.URL ; 24 25 28 public class DelegatingWebBrowserImpl extends ExtBrowserImpl { 29 30 private NbDdeBrowserImpl ddeImpl; 31 private UnixBrowserImpl unixImpl; 32 private SimpleExtBrowserImpl simpleImpl; 33 34 35 public DelegatingWebBrowserImpl() { 36 } 37 38 39 public DelegatingWebBrowserImpl(ExtWebBrowser extBrowserFactory) { 40 this.extBrowserFactory = extBrowserFactory; 41 } 42 43 public ExtBrowserImpl getImplementation() { 44 String pName = extBrowserFactory.getBrowserExecutable().getProcessName().toUpperCase(); 45 46 if (pName != null) { 47 48 if (Utilities.isWindows()) { 51 if (pName.indexOf("IEXPLORE.EXE") > -1 || pName.indexOf("NETSCP.EXE") > -1 || pName.indexOf("MOZILLA.EXE") > -1 || pName.indexOf("FIREFOX.EXE") > -1 || pName.indexOf("NETSCAPE.EXE") > -1) { if (ddeImpl == null) { 57 ddeImpl = new NbDdeBrowserImpl(extBrowserFactory); 58 } 59 return ddeImpl; 60 } 61 62 } else if (Utilities.isUnix() && !Utilities.isMac()) { 64 if (pName.indexOf("MOZILLA") > -1 || pName.indexOf("NETSCAPE") > -1 || 66 pName.indexOf("FIREFOX") > -1) { if (unixImpl == null) { 68 unixImpl = new UnixBrowserImpl(extBrowserFactory); 69 } 70 return unixImpl; 71 } 72 } 73 } 74 75 if (simpleImpl == null) { 77 simpleImpl = new SimpleExtBrowserImpl(extBrowserFactory); 78 } 79 return simpleImpl; 80 } 81 82 86 public void setURL(URL url) { 87 getImplementation().setURL(url); 88 } 89 90 } 91 | Popular Tags |