Package org.gudy.azureus2.core3.disk

Examples of org.gudy.azureus2.core3.disk.DiskManagerFileInfo


    });
    info.setProficiency(TableColumnInfo.PROFICIENCY_INTERMEDIATE);
  }

  public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
    long value = (fileInfo == null) ? 0 : fileInfo.getNbPieces();

    if( !cell.setSortValue( value ) && cell.isValid() ) {
      return;
    }
   
View Full Code Here


      setUserData("noInplaceEdit", new Integer(1));
  }
 
  public void refresh(TableCell cell, boolean sortOnlyRefresh)
  {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    String name = (fileInfo == null) ? "" : fileInfo.getFile(true).getName();
    if (name == null)
      name = "";
    //setText returns true only if the text is updated
    if (cell.setText(name) || !cell.isValid()) {
      if (bShowIcon && !sortOnlyRefresh) {
        Image icon;
        if (fileInfo == null) {
          icon = null;
        } else {
          // Don't ever dispose of PathIcon, it's cached and may be used elsewhere
          icon = ImageRepository.getPathIcon(fileInfo.getFile(true).getPath(),
              false, false);
        }

        // cheat for core, since we really know it's a TabeCellImpl and want to use
        // those special functions not available to Plugins
View Full Code Here

  {
    refresh(cell, false);
  }

  public String getObfusticatedText(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    String name = (fileInfo == null) ? ""
        : Debug.secretFileName(fileInfo.getFile(true).getName());
    if (name == null)
      name = "";
    return name;
  }
View Full Code Here

  }
 
  public boolean inplaceValueSet(TableCell cell, String value, boolean finalEdit) {
    if (value.equalsIgnoreCase(cell.getText()) || "".equals(value) || "".equals(cell.getText()))
      return true;
    final DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    final File target;
   
    try
    {
      target = new File(fileInfo.getFile(true).getParentFile(), value).getCanonicalFile();
    } catch (IOException e)
    {
      return false;
    }
     
    if(!finalEdit)
      return !target.exists();

   
    if(target.exists())
      return false;
   

    // code stolen from FilesView
    final boolean[] result = { false };
    boolean paused = fileInfo.getDownloadManager().pause();
    FileUtil.runAsTask(new AzureusCoreOperationTask()
    {
      public void run(AzureusCoreOperation operation) {
        result[0] = fileInfo.setLink(target);
      }
    });
    if(paused)
      fileInfo.getDownloadManager().resume();
   
    if (!result[0])
    {
      new MessageBoxShell(SWT.ICON_ERROR | SWT.OK,
          MessageText.getString("FilesView.rename.failed.title"),
View Full Code Here

    });
    info.setProficiency(TableColumnInfo.PROFICIENCY_BEGINNER);
  }

  public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo) cell.getDataSource();
    String tmp;
    int sortval = 0;
    if (fileInfo == null)
      tmp = "";
    else
    {
      int  st = fileInfo.getStorageType();
      if((st == DiskManagerFileInfo.ST_COMPACT || st == DiskManagerFileInfo.ST_REORDER_COMPACT ) && fileInfo.isSkipped())
      {
        tmp = MessageText.getString("FileItem.delete");
        sortval = 1;       
      } else if (fileInfo.isSkipped())
      {
        tmp = MessageText.getString("FileItem.donotdownload");
        sortval = 2;
      } else if (fileInfo.getPriority() > 0 ) {
       
        int pri = fileInfo.getPriority();
        tmp = MessageText.getString("FileItem.high");
        sortval = 4;
       
        if ( pri > 1 ){
          tmp += " (" + pri + ")";
View Full Code Here

    });
    info.setProficiency(TableColumnInfo.PROFICIENCY_INTERMEDIATE);
  }

  public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
    String tmp;
    if (fileInfo == null) {
      tmp = "";
    } else {
      int st = fileInfo.getStorageType();
      if (st == DiskManagerFileInfo.ST_LINEAR ){
        tmp = MessageText.getString("FileItem.storage.linear");
      }else if ( st == DiskManagerFileInfo.ST_COMPACT ){
        tmp = MessageText.getString("FileItem.storage.compact");
      }else{
View Full Code Here

    });
    info.setProficiency(TableColumnInfo.PROFICIENCY_INTERMEDIATE);
  }

  public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
    long value = (fileInfo == null) ? 0 : fileInfo.getAccessMode();

    if( !cell.setSortValue( value ) && cell.isValid() ) {
      return;
    }
   
View Full Code Here

    });
    info.setProficiency(TableColumnInfo.PROFICIENCY_BEGINNER);
  }

  public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
    cell.setText(determinePath(fileInfo));
  }
View Full Code Here

    });
    info.setProficiency(TableColumnInfo.PROFICIENCY_BEGINNER);
  }

  public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
    long value = (fileInfo == null) ? 0 : fileInfo.getDownloaded();

    if( !cell.setSortValue( value ) && cell.isValid() ) {
      return;
    }
   
View Full Code Here

    });
    info.setProficiency(TableColumnInfo.PROFICIENCY_ADVANCED);
  }

  public void refresh(TableCell cell) {
    DiskManagerFileInfo fileInfo = (DiskManagerFileInfo)cell.getDataSource();
    long sort_value;
   
    if ( fileInfo == null ){
      sort_value = 0;
    }else{
      sort_value = fileInfo.getFirstPieceNumber();
     
      if ( sort_value >= 0 ){
       
        sort_value = (sort_value << 32) + fileInfo.getIndex();
      }
    }

   
    if( !cell.setSortValue( sort_value ) && cell.isValid() ) {
      return;
    }
   
    // < 0 -> unknown skeleton value
 
    cell.setText( sort_value<0?"":(""+fileInfo.getFirstPieceNumber()));
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.core3.disk.DiskManagerFileInfo

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.