1 19 20 package org.netbeans.modules.extbrowser; 21 22 import java.beans.*; 23 import java.io.IOException ; 24 import java.net.URL ; 25 26 import org.openide.NotifyDescriptor; 27 import org.openide.util.NbBundle; 28 import org.openide.execution.NbProcessDescriptor; 29 import org.openide.ErrorManager; 30 31 34 public class SimpleExtBrowserImpl extends ExtBrowserImpl { 35 36 public SimpleExtBrowserImpl(ExtWebBrowser extBrowserFactory) { 37 super(); 38 this.extBrowserFactory = extBrowserFactory; 39 if (ExtWebBrowser.getEM().isLoggable(ErrorManager.INFORMATIONAL)) { 40 ExtWebBrowser.getEM().log("SimpleExtBrowserImpl created from factory: " + extBrowserFactory); } 42 } 43 44 47 public void setURL(URL url) { 48 if (url == null) { 49 return; 50 } 51 52 try { 53 url = URLUtil.createExternalURL(url, false); 54 NbProcessDescriptor np = extBrowserFactory.getBrowserExecutable(); 55 if (np != null) { 56 np.exec(new SimpleExtBrowser.BrowserFormat((url == null)? "": url.toString())); } 58 this.url = url; 59 } catch (IOException ex) { 60 org.openide.DialogDisplayer.getDefault().notify( 61 new NotifyDescriptor.Confirmation( 62 NbBundle.getMessage(SimpleExtBrowserImpl.class, "EXC_Invalid_Processor"), 63 NotifyDescriptor.DEFAULT_OPTION, NotifyDescriptor.WARNING_MESSAGE 64 ) 65 ); 66 } 67 } 68 69 } | Popular Tags |