예제 #1
0
파일: Desktop.java 프로젝트: Paxle/Paxle
  private boolean browseImpl(URL url) throws DesktopException {
    final String prop = System.getProperty("paxle.desktop.jdic.browse", "default");
    final BrowserService browserService =
        (BrowserService) ServiceManager.getService(ServiceManager.BROWSER_SERVICE);
    try {
      if (browserService
          .getClass()
          .getName()
          .equals("org.jdesktop.jdic.desktop.internal.impl.WinBrowserService")) {
        if (prop.equals("reflect")) {
          browseWinReflect(url);
        } else {
          // default if Windows
          browseWinRundll(url);
        }

        return true;
      } else {
        // default if other OS
        browserService.show(url);
        return true;
      }
    } catch (LaunchFailedException e) {
      final DesktopException ex = new DesktopException("Failed launching default browser");
      ex.initCause(e);
      throw ex;
    }
  }
예제 #2
0
파일: Desktop.java 프로젝트: Paxle/Paxle
 public boolean browse(URL url) {
   try {
     return browseImpl(url);
   } catch (DesktopException e) {
     if (logger.isDebugEnabled()) {
       logger.error("Backend error starting browser", e);
     } else {
       logger.error(e.getMessage());
     }
     return false;
   } catch (LinkageError e) {
     logger.error("Linkage error starting browser: " + e.getMessage());
     return false;
   }
 }