HtmlBrowser.URLDisplayer.getDefault().showURL(registerPage.toURI().toURL()); HtmlBrowser.URLDisplayer.getDefault().showURL(registerPage.toURI().toURL());
private void btnDonateMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnDonateMouseClicked try { HtmlBrowser.URLDisplayer.getDefault().showURLExternal(new URL("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=K4CMP92RZELE2")); } catch (MalformedURLException ex) { Exceptions.printStackTrace(ex); } }//GEN-LAST:event_btnDonateMouseClicked
URLDisplayer.getDefault().showURL(url);
String invalid = location.getInvalidMessage(); if (url != null) { HtmlBrowser.URLDisplayer.getDefault().showURL(url); } else if (invalid != null) {
HtmlBrowser.URLDisplayer.getDefault().showURL(url); } else { HtmlBrowser.URLDisplayer.getDefault().showURL(url); return;
try { URL url = new URL(token.getImage()); HtmlBrowser.URLDisplayer.getDefault().showURL(url); } catch (MalformedURLException ex) { ex.printStackTrace();
HtmlBrowser.URLDisplayer.getDefault().showURL(javadocUrl); } else { StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(DependencyNode.class, "ERR_No_Javadoc_Found", fil.getPath()));
URLDisplayer.getDefault().showURL(e.getURL()); return;
URL url = e.getURL(); if (url!=null && !(url.getProtocol().equals("file") || url.getProtocol().equals("issue")) ) { // NOI18N URLDisplayer.getDefault().showURL(url); } else { String link = e.getDescription();
public CompletionDocumentation resolveLink(String link) { if (link.startsWith("www.")) { link = "http://" + link; } if (link.matches("[a-z]+://.*")) { // NOI18N try { URL url = new URL(link); HtmlBrowser.URLDisplayer.getDefault().showURL(url); return null; } catch (MalformedURLException mue) { Exceptions.printStackTrace(mue); } } ElementHandle handle = language.getCompletionProvider().resolveLink(link, elementHandle); if (handle != null) { URL url = null; if(handle instanceof ElementHandle.UrlHandle) { String url_text = ((ElementHandle.UrlHandle)handle).getUrl(); try { url = new URL(url_text); } catch (MalformedURLException mue) { Logger.getLogger("global").log(Level.INFO, null, mue); } } return new GsfCompletionDoc(controller, handle, url); } return null; }
@Override public void showURL(URL applicationRootURL, URL urlToOpenInBrowser, FileObject context) { projectRootURL = applicationRootURL == null ? null : WebUtils.urlToString(applicationRootURL); if (projectRootURL != null && !projectRootURL.contains(".") && !projectRootURL.endsWith("/")) { projectRootURL += "/"; } if (project.getProjectDirectory().equals(context) && webProject != null) { // this is scenario of EAR project executing its Web Project; use // Web Project as context instead of EAR here: context = webProject.getProjectDirectory(); } // let browser update URL if necessary: WebBrowser browser = getWebBrowser(); if (browser != null) { urlToOpenInBrowser = browser.toBrowserURL(getWebProject(), context, urlToOpenInBrowser); browserUsageLogger.log(projectType, browser.getId(), browser.getBrowserFamily().name()); } else { WebBrowser wb = BrowserUISupport.getDefaultBrowserChoice(true); browserUsageLogger.log(projectType, wb.getId(), wb.getBrowserFamily().name()); } BrowserSupport bs = getBrowserSupport(); if (bs != null) { bs.load(urlToOpenInBrowser, context); } else { HtmlBrowser.URLDisplayer.getDefault().showURL(urlToOpenInBrowser); } }
@Override public void run() { try { File file = saveToTempFile(); String contentType = getContentType(); if ("image/png".equals(contentType) //NOI18N || "image/gif".equals(contentType) //NOI18N || "image/jpeg".equals(contentType)) { //NOI18N HtmlBrowser.URLDisplayer.getDefault().showURL(Utilities.toURI(file).toURL()); } else { file = FileUtil.normalizeFile(file); FileObject fob = FileUtil.toFileObject(file); DataObject dob = DataObject.find(fob); OpenCookie open = dob.getCookie(OpenCookie.class); if (open != null) { open.open(); } else { // PENDING } } } catch (DataObjectNotFoundException dnfex) { LOG.log(Level.INFO, dnfex.getMessage(), dnfex); } catch (IOException ioex) { LOG.log(Level.INFO, ioex.getMessage(), ioex); } finally { handle.finish(); } } });
private void showLandingPage(Set<CreatedProjectInfo> projects) { CreatedProjectInfo cpi = projects.iterator().next(); KenaiProject kenaiPrj = cpi.project; String localPath = cpi.localRepoPath; Object options[] = new Object[3]; options[0] = new JButton(NbBundle.getMessage(NewKenaiProjectAction.class, "NewKenaiProjectAction.goToKenai", kenaiPrj.getKenai())); options[1] = new JButton(NbBundle.getMessage(NewKenaiProjectAction.class, "NewKenaiProjectAction.createNewProject")); options[2] = new JButton(NbBundle.getMessage(NewKenaiProjectAction.class, "NewKenaiProjectAction.close")); DialogDescriptor dialogDesc = new DialogDescriptor(new LandingPagePanel(kenaiPrj.getName(), localPath, kenaiPrj.getKenai().getName()), NbBundle.getMessage(NewKenaiProjectAction.class, "NewKenaiProjectAction.dialogTitle"), true, options, options[0], DialogDescriptor.DEFAULT_ALIGN, null, null); Object option = DialogDisplayer.getDefault().notify(dialogDesc); if (options[0].equals(option)) { // open Kenai project page URL projectUrl = kenaiPrj.getWebLocation(); URLDisplayer.getDefault().showURL(projectUrl); } else if (options[1].equals(option)) { // create NB project Action newProjectAction = CommonProjectActions.newProjectAction(); File projPath = null; if (localPath != null) { projPath = new File(localPath); } if (newProjectAction != null && projPath != null && projPath.exists()) { ProjectChooser.setProjectsFolder(projPath); newProjectAction.actionPerformed(new ActionEvent(NewKenaiProjectAction.class, ActionEvent.ACTION_PERFORMED, "command")); // NOI18N } } }
/** * Opens a browser for JDK product registration. * @param url Registration Webapp URL */ private static void openBrowser(URL url) throws IOException { if (BrowserSupport.isSupported()) { try { BrowserSupport.browse(url.toURI()); } catch (URISyntaxException ex) { InternalError x = new InternalError("Error in registering: " + ex.getMessage()); x.initCause(ex); throw x; } catch (IllegalArgumentException ex) { LOG.log(Level.FINE,"Cannot open browser:",ex); } catch (UnsupportedOperationException ex) { // ignore if not supported LOG.log(Level.FINE,"Cannot open browser:",ex); } catch (IOException ex) { //fallback to openide API LOG.log(Level.FINE,"Cannot open browser:",ex); HtmlBrowser.URLDisplayer.getDefault().showURL(url); } } else { //Fallback to openide API in JDK 5 HtmlBrowser.URLDisplayer.getDefault().showURL(url); } }
public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ENTERED) { issuesInfoPane.setToolTipText(e.getDescription()); issuesInfoPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); return; } if (e.getEventType() == HyperlinkEvent.EventType.EXITED) { issuesInfoPane.setToolTipText(""); //NOI18N issuesInfoPane.setCursor(Cursor.getDefaultCursor()); return; } if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (e.getDescription().startsWith("issue:")) { //NOI18N final String issueNumber = e.getDescription().substring(6); SwingUtilities.invokeLater(new Runnable() { public void run() { KenaiIssueAccessor.getDefault().open(instPr, issueNumber); } }); return; } URLDisplayer.getDefault().showURL(e.getURL()); return; } } });
public void run() { try { if(node.getDeploymentManager().isRunning()) { String url = node.getAdminURL() + "/?" + genRandomString() + "=" + genRandomString(); URLDisplayer.getDefault().showURL(new URL(url)); } else { Util.showInformation(NbBundle.getMessage(ShowAdminToolAction.class, "MESS_START_INSTANCE")); } } catch(MissingResourceException ex) { // this should not happen... If it does, we should find out. ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); } catch(MalformedURLException ex) { // this should not happen... If it does, we should find out. ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); } catch(Exception ex){ ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, ex); } } });
public void performAction() { org.openide.awt.StatusDisplayer.getDefault().setStatusText( NbBundle.getBundle(HTMLViewAction.class).getString("CTL_OpeningBrowser")); try { HtmlBrowser.URLDisplayer.getDefault().showURL( new java.net.URL(HtmlBrowser.getHomePage () )); } catch (java.net.MalformedURLException e) { String home = HtmlBrowser.getHomePage (); if (!home.startsWith ("http://")) { // NOI18N home = "http://" + home; // NOI18N } try { HtmlBrowser.URLDisplayer.getDefault().showURL( new java.net.URL(home)); } catch (java.net.MalformedURLException e1) { Exceptions.printStackTrace(e1); } } }
public void showFileUrl(URL url, FileObject file) { // let browser update URL if necessary: WebBrowser browser = getWebBrowser(); if (browser != null) { url = browser.toBrowserURL(project, file, url); } BrowserSupport support = getBrowserSupport(); if (support != null) { support.load(url, file); } else { HtmlBrowser.URLDisplayer.getDefault().showURL(url); } // usage logging if (browser == null) { // default ide browser browser = BrowserUISupport.getDefaultBrowserChoice(true); } browserUsageLogger.log(PhpProjectType.TYPE, browser.getId(), browser.getBrowserFamily().name()); }
@Override public void hyperlinkUpdate(HyperlinkEvent e) { if(HyperlinkEvent.EventType.ENTERED == e.getEventType()) { if (CHECK_FOR_UPDATES_ACTION.equals(e.getDescription())) { description.setToolTipText(check_for_updates()); } else if (e.getURL() != null) { description.setToolTipText(e.getURL().toExternalForm()); } } else if (HyperlinkEvent.EventType.EXITED == e.getEventType()) { description.setToolTipText(null); } else if (HyperlinkEvent.EventType.ACTIVATED.equals(e.getEventType())) { if (CHECK_FOR_UPDATES_ACTION.equals(e.getDescription())) { checkForUpdates(); } else { URLDisplayer.getDefault().showURL(e.getURL()); } } } });
public void run() { // TODO - wait for the file to be created // Open brower on the doc directory FileObject doc = project.getProjectDirectory().getFileObject("doc"); // NOI18N if (doc != null) { FileObject index = doc.getFileObject("index.html"); // NOI18N if (index != null) { try { URL url = FileUtil.toFile(index).toURI().toURL(); HtmlBrowser.URLDisplayer.getDefault().showURL(url); } catch (MalformedURLException ex) { ErrorManager.getDefault().notify(ex); } } } } };