FileDocCategorySizeDatePackage
CategoryItem.javaAPI DocAzureus 3.0.3.43058Thu Jan 11 10:00:12 GMT 2007org.gudy.azureus2.ui.swt.views.tableitems.mytracker

CategoryItem

public class CategoryItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener
author
parg

Fields Summary
protected static final org.gudy.azureus2.plugins.torrent.TorrentAttribute
category_attribute
Default Constructor
protected static final com.aelitis.azureus.core.AzureusCore
azureus_core
Constructors Summary
public CategoryItem()

	
	 
	 
	
		super("category", CoreTableColumn.POSITION_INVISIBLE, 400, TableManager.TABLE_MYTRACKER);
		
		setRefreshInterval(INTERVAL_LIVE);
	
Methods Summary
public voidrefresh(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

	    TRHostTorrent tr_torrent = (TRHostTorrent)cell.getDataSource();
		
		if ( tr_torrent == null ){
			
			cell.setText("");
			
		}else{
			
			TOTorrent	torrent = tr_torrent.getTorrent();
			
			DownloadManager dm = azureus_core.getGlobalManager().getDownloadManager( torrent );

			String	cat_str = null;

			if ( dm != null ){
			
			    Category cat = dm.getDownloadState().getCategory();   
				
				if (cat != null){
					
					cat_str = cat.getName();
				}
			}else{
				
					// pick up specific torrent category, bit 'o' a hack tis
			
				cat_str = TorrentUtils.getPluginStringProperty( torrent, "azcoreplugins.category" );
			}
			
			cell.setText( cat_str==null?"":cat_str);
		}