Package org.rssowl.contrib.podcast.core.download

Examples of org.rssowl.contrib.podcast.core.download.Download


            gc.fillRectangle(rect);
            return;
        }

        if (content instanceof Download) {
            Download lDownload = (Download) content;
            String lDraw = "";
            switch (col) {
                case 0: { // The download index.
                    lDraw = new Integer(row).toString();
                }
                    break;
                case 1: { // The file name.
                    if (lDownload.getAttachment().getFile() != null) {
                        lDraw = lDownload.getAttachment().getFile().getName();
                    }else{
                      lDraw = "Error, File name not set";
                    }
                }
                    break; // The feed title.
                case 2: {
                    lDraw = lDownload.getAttachment().getNews().getFeedReference().resolve().getTitle();
                }
                    break;
                case 3: {
                    lDraw = "TODO"; // this is the proress bar.
                }
                    break;
                case 4: {
                    lDraw = Util.formatSpeed(lDownload.getBytesPerSecond())
                            + " kB/s";
                }
                    break;
                case 5: {
                    lDraw = Util.formatTime(lDownload.getTimeElapsed());
                }
                    break;
                case 6: {
                    String status = KDownloadTableModel.STATUS_NAMES[lDownload
                            .getState()];

                    if (lDownload.getState() == DownloadService.RETRYING
                            || lDownload.getState() == DownloadService.ERROR
                            || lDownload.getState() == DownloadService.RELEASING) {
                        status += lDownload.getMessage();
                    }
                    lDraw = status;
                }
                    break;
                case 7: {
                    lDraw = Util.formatSize(lDownload.getCurrent());
                }
            }
            gc.setForeground(textColor);
            gc.setBackground(backColor);
            gc.fillRectangle(rect);
View Full Code Here


    // Do some state updating an a UI update.
    if (mView == null && mView.getView().isDisposed()) {
      return;
    }

    final Download lDownload = (Download) event.getSource();
    Display.getDefault().asyncExec(new Runnable() {
      public void run() {
        if (event.getNetEvent() == NetTaskEvent.DOWNLOAD_SUCCESS) {
        }
        if (event.getNetEvent() == NetTaskEvent.DOWNLOAD_STATUS_CHANGED) {
        }
        if (event.getNetEvent() == NetTaskEvent.DOWNLOAD_FAILED) {
        }
        mView.update(lDownload.getAttachment());
      }
    });
  }
View Full Code Here

   * @return
   */
  private String getColumnText(Object element, int columnIndex) {
    String lDraw = "";
    if (element instanceof IDownload) {
      Download lDownload = (Download) element;
      int row = DownloadService.getInstance().indexOf(lDownload);

      switch (columnIndex) {
      case 0: { // The download index.
        lDraw = new Integer(row).toString();
      }
        break;
      case 1: { // The file name.
        if (lDownload.getAttachment().getFile() != null) {
          lDraw = lDownload.getAttachment().getFile().getName();
        } else {
          lDraw = "Error, File name not set";
        }
      }
        break; // The feed title.
      case 2: {
        lDraw = lDownload.getAttachment().getNews().getFeedReference()
            .resolve().getTitle();
      }
        break;
      case 3: {
        lDraw = "TODO"; // this is the proress bar.
      }
        break;
      case 4: {
        lDraw = Util.formatSpeed(lDownload.getBytesPerSecond())
            + " kB/s";
      }
        break;
      case 5: {
        lDraw = Util.formatTime(lDownload.getTimeElapsed());
      }
        break;
      case 6: {
        String status = DownloadService.STATE_DESCRIPTION[lDownload
            .getState()];
        if (lDownload.getState() == DownloadService.RETRYING
            || lDownload.getState() == DownloadService.ERROR
            || lDownload.getState() == DownloadService.RELEASING) {
          status += lDownload.getMessage();
        }
        lDraw = status;
      }
        break;
      case 7: {
        lDraw = Util.formatSize(lDownload.getCurrent());
      }
      }
    }

    return lDraw;
View Full Code Here

   *
   * @see com.jpodder.net.INetTaskListener#netActionPerformed(com.jpodder.net.NetTaskEvent)
   */
  public void netActionPerformed(final NetTaskEvent event) {

    final Download lDownload = (Download) event.getSource();
    Display.getDefault().asyncExec(new Runnable() {
      public void run() {
        // CB TODO Actions update mechanism is changed.
        // mPauzeResumeAllAction.update();
        // mCleanAllCompletedAction.update(lDownload);
View Full Code Here

TOP

Related Classes of org.rssowl.contrib.podcast.core.download.Download

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.