FileDocCategorySizeDatePackage
TypeItem.javaAPI DocAzureus 3.0.3.42322Thu Feb 09 19:43:20 GMT 2006org.gudy.azureus2.ui.swt.views.tableitems.myshares

TypeItem

public class TypeItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements TableCellRefreshListener
author
TuxPaper
since
2.0.8.5

Fields Summary
Constructors Summary
public TypeItem()
Default Constructor

    super("type", POSITION_LAST, 100, TableManager.TABLE_MYSHARES);
  
Methods Summary
public voidrefresh(TableCell cell)

    ShareResource item = (ShareResource)cell.getDataSource();
    
    String text = "";
    
    if( item != null ) {
      int type = item.getType();
      
      if( !cell.setSortValue( type ) && cell.isValid() ) {
        return;
      }
      
      if (type == ShareResource.ST_DIR)
        text = MessageText.getString( "MySharesView.type.dir" );
      else if (type == ShareResource.ST_FILE)
        text = MessageText.getString( "MySharesView.type.file" );
      else if (type == ShareResource.ST_DIR_CONTENTS) {
        ShareResourceDirContents s = (ShareResourceDirContents)item;
        if (s.isRecursive())
          text = MessageText.getString( "MySharesView.type.dircontentsrecursive" );
        else
          text = MessageText.getString( "MySharesView.type.dircontents" );
      }
    }
    
    cell.setText( text );