Example #1
0
 public void downloadInactive(Download download) {
   synchronized (listeners) {
     for (int i = 0; i < listenersDownload.size(); i++) {
       Download lDownload = (Download) listenersDownload.get(i);
       if (download.equals(lDownload)) {
         MessageListener listener = (MessageListener) listeners.get(i);
         listener.downloadInactive(download);
       }
     }
   }
 }
Example #2
0
  public void addMessageListener(MessageListener listener, Download download) {
    synchronized (listeners) {
      listeners.add(listener);
      listenersDownload.add(download);
    }

    listener.downloadAdded(download);
    if (controller.isDownloadActive(download)) {
      listener.downloadActive(download);
    } else {
      listener.downloadInactive(download);
    }
  }