コード例 #1
0
  @Override
  public void onAction(ActionEvent e) {
    if (!UserIO.isOK(
        UserIO.getInstance()
            .requestConfirmDialog(
                UserIO.DONT_SHOW_AGAIN | UserIO.DONT_SHOW_AGAIN_IGNORES_CANCEL,
                JDL.L(
                    "jd.gui.swing.jdgui.menu.actions.RemoveDisabledAction.message",
                    "Do you really want to remove all disabled DownloadLinks?")))) return;

    if (!LinkGrabberPanel.getLinkGrabber().isNotVisible()) {
      synchronized (LinkGrabberController.ControllerLock) {
        synchronized (LinkGrabberController.getInstance().getPackages()) {
          ArrayList<LinkGrabberFilePackage> selected_packages =
              new ArrayList<LinkGrabberFilePackage>(
                  LinkGrabberController.getInstance().getPackages());
          selected_packages.add(LinkGrabberController.getInstance().getFilterPackage());
          for (LinkGrabberFilePackage fp2 : selected_packages) {
            ArrayList<DownloadLink> links = new ArrayList<DownloadLink>(fp2.getDownloadLinks());
            for (DownloadLink dl : links) {
              if (!dl.isEnabled()) fp2.remove(dl);
            }
          }
        }
      }
    } else {
      DownloadController dlc = DownloadController.getInstance();
      ArrayList<DownloadLink> downloadstodelete = new ArrayList<DownloadLink>();
      synchronized (dlc.getPackages()) {
        for (FilePackage fp : dlc.getPackages()) {
          synchronized (fp.getDownloadLinkList()) {
            for (DownloadLink dl : fp.getDownloadLinkList()) {
              if (!dl.isEnabled()) downloadstodelete.add(dl);
            }
          }
        }
      }
      for (DownloadLink dl : downloadstodelete) {
        dl.getFilePackage().remove(dl);
      }
    }
  }
コード例 #2
0
ファイル: KeezMoviesCom.java プロジェクト: sn0w/jdownloader
 @SuppressWarnings("deprecation")
 private void getPolicyFiles() throws Exception {
   int ret = -100;
   UserIO.setCountdownTime(120);
   ret =
       UserIO.getInstance()
           .requestConfirmDialog(
               UserIO.STYLE_LARGE,
               "Java Cryptography Extension (JCE) Error: 32 Byte keylength is not supported!",
               "At the moment your Java version only supports a maximum keylength of 16 Bytes but the keezmovies plugin needs support for 32 byte keys.\r\nFor such a case Java offers so called \"Policy Files\" which increase the keylength to 32 bytes. You have to copy them to your Java-Home-Directory to do this!\r\nExample path: \"jre6\\lib\\security\\\". The path is different for older Java versions so you might have to adapt it.\r\n\r\nMake sure to download the files that match your current Java version!\r\n\r\nBy clicking on CONFIRM a browser instance will open which leads to the downloadpage of the file.\r\n\r\nThanks for your understanding.",
               null,
               "CONFIRM",
               "Cancel");
   if (ret != -100) {
     if (UserIO.isOK(ret)) {
       LocalBrowser.openDefaultURL(
           new URL(
               "http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html"));
       LocalBrowser.openDefaultURL(new URL("http://h10.abload.de/img/jcedp50.png"));
     } else {
       return;
     }
   }
 }