/** * Opens a specified URL with the browser. * * @param url * The specified URL. * @throws UtilsException */ public static void openURL(URL url) throws UtilsException { openURL(url.toString()); }
/** * Opens a specified URL with the browser. * * @param url * The specified URL. * @throws UtilsException */ public static void openURL(URL url) throws UtilsException { openURL(url.toString()); }
/** * @param firstElement */ private void findAndLuanchBrowser(XmlElement firstElement) { Iterator children = ((XmlElement) firstElement).children().iterator(); while (children.hasNext()) { Object object = (Object) children.next(); if (object instanceof String) { try { new URL(((String) object).trim()); try { BrowserLauncher.openURL(((String) object).trim()); } catch (Throwable e) { // do nothing } } catch (MalformedURLException e) { // do nothing } } else if (object instanceof XmlElement) { findAndLuanchBrowser((XmlElement) object); } } } });
public void hyperlinkUpdate(HyperlinkEvent event) { if (event.getEventType() == EventType.ACTIVATED) { URL url = event.getURL(); try { BrowserLauncher.openURL(url.toString()); } catch (Exception e) { MonitorWindow.this.xbayaGUI.getErrorWindow().error(MonitorWindow.this.dialog.getDialog(), e.getMessage(), e); } } } });
public void hyperlinkUpdate(HyperlinkEvent event) { logger.debug("Event:" + event); if (event.getEventType() == EventType.ACTIVATED) { URL url = event.getURL(); try { BrowserLauncher.openURL(url.toString()); } catch (Exception e) { TextWindow.this.engine.getGUI().getErrorWindow().error(TextWindow.this.dialog.getDialog(), e.getMessage(), e); } } } });
public void hyperlinkUpdate(HyperlinkEvent event) { logger.debug("Event:" + event); if (event.getEventType() == EventType.ACTIVATED) { URL url = event.getURL(); try { BrowserLauncher.openURL(url.toString()); } catch (Exception e) { AboutWindow.this.engine.getGUI().getErrorWindow().error(AboutWindow.this.dialog.getDialog(), e.getMessage(), e); } } } });
/** * Shows a configuration window when a user click the configuration area. * * @param engine */ @Override protected void showConfigurationDialog(XBayaGUI xbayaGUI) { if (this.node instanceof OutputNode) { String description = ((OutputNode) this.node).getDescription(); if (null != description) { // try to parse it to a URL and if yes try to open the browser try { description = description.trim(); URL url = new URL(description); // no exception -> valid url lets try to open it BrowserLauncher.openURL(url); } catch (Exception e) { // do nothing since this is an optional attempt } } } if (this.configurationWindow == null) { this.configurationWindow = new OutputConfigurationDialog(this.outputNode, xbayaGUI); } this.configurationWindow.show(); }