public void openInExternalBrowser(@NotNull String link) {
      if (!BrowserUtil.isAbsoluteURL(link)) {
        try {
          link = new URI("http", link, null).toURL().toString();
        } catch (Exception ignore) {
        }
      }

      BrowserUtil.browse(link);
    }
예제 #2
0
 private void showHelpForCurrentMessage() {
   String helpURL = getHelpUrlForCurrentMessage();
   if (helpURL == null) {
     return;
   }
   BrowserUtil.browse(helpURL);
 }
예제 #3
0
  @Override
  protected void doOKAction() {
    if (hasPatch()) {
      super.doOKAction();
      return;
    }

    if (myLatestBuild.getButtons().size() > 0) {
      BrowserUtil.launchBrowser(myLatestBuild.getButtons().get(0).getUrl());
    } else {
      openDownloadPage();
    }
    super.doOKAction();
  }
  @Override
  public boolean onClick(@NotNull MouseEvent e, int clickCount) {
    if (e.getButton() == 1 && !e.isPopupTrigger()) {
      Object tag = getTagAt(e);
      if (tag instanceof Runnable) {
        ((Runnable) tag).run();
        return true;
      }

      if (tag != null && !Object.class.getName().equals(tag.getClass().getName())) {
        BrowserUtil.browse(tag.toString());
        return true;
      }
    }
    return false;
  }
 @Override
 public void selectIn(SelectInContext context, boolean requestFocus) {
   PsiElement psiElement = (PsiElement) context.getSelectorInFile();
   LOG.assertTrue(psiElement != null);
   PsiFile psiFile = psiElement.getContainingFile();
   LOG.assertTrue(psiFile != null);
   try {
     Url url = WebBrowserService.getInstance().getUrlToOpen(psiFile, false);
     if (url != null) {
       ApplicationManager.getApplication().saveAll();
       BrowserUtil.launchBrowser(url.toExternalForm());
     }
   } catch (WebBrowserUrlProvider.BrowserException e1) {
     Messages.showErrorDialog(e1.getMessage(), XmlBundle.message("browser.error"));
   } catch (Exception e1) {
     LOG.error(e1);
   }
 }
  public void addBackAndOpenButtons() {
    ApplicationManager.getApplication()
        .invokeLater(
            () -> {
              final JPanel panel = new JPanel();
              panel.setLayout(new BoxLayout(panel, BoxLayout.X_AXIS));

              final JButton backButton =
                  makeGoButton("Click to go back", AllIcons.Actions.Back, -1);
              final JButton forwardButton =
                  makeGoButton("Click to go forward", AllIcons.Actions.Forward, 1);
              final JButton openInBrowser = new JButton(AllIcons.Actions.Browser_externalJavaDoc);
              openInBrowser.addActionListener(e -> BrowserUtil.browse(myEngine.getLocation()));
              openInBrowser.setToolTipText("Click to open link in browser");
              addButtonsAvailabilityListeners(backButton, forwardButton);

              panel.setMaximumSize(new Dimension(40, getPanel().getHeight()));
              panel.add(backButton);
              panel.add(forwardButton);
              panel.add(openInBrowser);

              add(panel, BorderLayout.PAGE_START);
            });
  }
예제 #7
0
 private void openDownloadPage() {
   BrowserUtil.launchBrowser(myUpdatedChannel.getHomePageUrl());
 }
예제 #8
0
 @Override
 public void actionPerformed(ActionEvent e) {
   BrowserUtil.launchBrowser(myInfo.getUrl());
 }
 @Override
 public void actionPerformed(AnActionEvent event) {
   BrowserUtil.browse(getUrl());
 }
 public void actionPerformed(AnActionEvent e) {
   String url = getIssueUrl(e);
   if (url != null) {
     BrowserUtil.browse(url);
   }
 }
 @Override
 public void run() {
   BrowserUtil.browse(myUrl);
 }
 @Override
 public void actionPerformed(AnActionEvent e) {
   BrowserUtil.launchBrowser(myUrl);
 }
 @Override
 protected void doOKAction() {
   BrowserUtil.browse(myChannel.getHomePageUrl());
   super.doOKAction();
 }