@Override public void showURL(URL u) { if (Desktop.isDesktopSupported()) { Desktop d = Desktop.getDesktop(); if (d.isSupported(Desktop.Action.BROWSE)) { try { d.browse(u.toURI()); return; } catch (Exception x) { Logger.getLogger(HtmlBrowser.class.getName()).log(Level.INFO, "Showing: " + u, x); } } } // Fallback implementation: HtmlBrowser browser = new HtmlBrowser(); browser.setURL(u); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.getContentPane().add(browser); frame.pack(); frame.setVisible(true); } }
setURL(txt); } else if (e.getSource() == bBack) {
/** Setter for help URL. * @param helpURL help URL */ public void setHelpURL(URL helpURL) { if (htmlBrowser == null) { return; } if (helpURL != null) { if (!helpURL.equals(htmlBrowser.getDocumentURL())) { htmlBrowser.setURL(helpURL); } if (tabbedPane != null) { tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), true); } } else if (tabbedPane != null) { tabbedPane.setSelectedComponent(contentPanel); tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), false); } }
/** * Sets new URL. * * @param str URL to show in this browser. */ public void setURL (String str) { if( null == browserComponent ) { urlToLoad = str; return; } urlToLoad = null; browserComponent.setURL (str); }
/** * Sets new URL. * * @param url URL to show in this browser. */ public void setURL (final URL url) { if( null == browserComponent ) { urlToLoad = null == url ? null : url.toExternalForm(); return; } urlToLoad = null; browserComponent.setURL (url); }
public void showURL(URL u) { HtmlBrowser browser = new HtmlBrowser(); browser.setURL(u); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.getContentPane().add(browser); frame.pack(); frame.setVisible(true); }
public void showURL(URL u) { HtmlBrowser browser = new HtmlBrowser(); browser.setURL(u); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); frame.getContentPane().add(browser); frame.pack(); frame.setVisible(true); }
@Override public void readExternal (ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal (in); setStatusLineVisible (in.readBoolean ()); setToolbarVisible (in.readBoolean ()); browserComponent.setURL ((URL) in.readObject ()); }
@Override public void propertyChange(PropertyChangeEvent ev) { if (ev.getPropertyName().equals(ExplorerManager.PROP_SELECTED_NODES)) { if (!configuring) { wizardPanel.visualPanelChanged(true); } FileObject template = getSelectedTemplate(); URL url = template != null ? (URL) template.getAttribute("instantiatingWizardURL") : null; // NOI18N descBrowser.setURL(url); } }
/** * Sets new URL. * * @param str URL to show in this browser. */ public void setURL (String str) { URL URL; try { URL = new java.net.URL (str); } catch (java.net.MalformedURLException ee) { try { URL = new java.net.URL ("http://" + str); // NOI18N } catch (java.net.MalformedURLException e) { if (browserImpl instanceof SwingBrowserImpl) { ((SwingBrowserImpl) browserImpl).setStatusText( NbBundle.getMessage(SwingBrowserImpl.class, "FMT_InvalidURL", new Object[] {str})); } else { ErrorManager.getDefault().notify(ee); } return; } } setURL (URL); }
/** * Sets new URL. * * @param str URL to show in this browser. */ public void setURL (String str) { URL URL; try { URL = new java.net.URL (str); } catch (java.net.MalformedURLException ee) { try { URL = new java.net.URL ("http://" + str); // NOI18N } catch (java.net.MalformedURLException e) { if (browserImpl instanceof SwingBrowserImpl) { ((SwingBrowserImpl) browserImpl).setStatusText( NbBundle.getMessage(SwingBrowserImpl.class, "FMT_InvalidURL", new Object[] {str})); } else { ErrorManager.getDefault().notify(ee); } return; } } setURL (URL); }
public void setURLAndOpen( URL url ) { createBrowser(); browserComponent.setURL(url); urlToLoad = null; if( null != browserComponent.getBrowserComponent() ) { open(); requestActive(); } }
/** Setter for help URL. * @param helpURL help URL */ public void setHelpURL(URL helpURL) { if (htmlBrowser == null) return; if (helpURL != null) { if (!helpURL.equals(htmlBrowser.getDocumentURL())) htmlBrowser.setURL(helpURL); if (tabbedPane != null) tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), true); } else if (tabbedPane != null){ tabbedPane.setSelectedComponent(contentPanel); tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), false); } }
/** Setter for help URL. * @param helpURL help URL */ public void setHelpURL(URL helpURL) { if (htmlBrowser == null) return; if (helpURL != null) { if (!helpURL.equals(htmlBrowser.getDocumentURL())) htmlBrowser.setURL(helpURL); if (tabbedPane != null) tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), true); } else if (tabbedPane != null){ tabbedPane.setSelectedComponent(contentPanel); tabbedPane.setEnabledAt(tabbedPane.indexOfComponent(htmlBrowser), false); } }
/** Updates description to reflect the one associated with given object. * @param obj object */ private void updateDescription (DataObject obj) { java.net.URL url = null; if (obj != null) { url = TemplateWizard.getDescription (obj); } java.awt.CardLayout card = (java.awt.CardLayout)browserPanel.getLayout(); if (url != null && getExplorerManager().getSelectedNodes().length != 0) { if (browser != null) { browser.setURL(url); if (!browser.isVisible()) { card.show (browserPanel, "browser"); // NOI18N } } } else { card.show (browserPanel, "noBrowser"); // NOI18N } }