FileDocCategorySizeDatePackage
CommentItem.javaAPI DocAzureus 3.0.3.42734Thu Jul 19 13:46:06 BST 2007org.gudy.azureus2.ui.swt.views.tableitems.mytorrents

CommentItem

public class CommentItem extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements TableCellRefreshListener, org.gudy.azureus2.ui.swt.debug.ObfusticateCellText, TableCellMouseListener
User-editable comment for a download.
author
amc1

Fields Summary
Constructors Summary
public CommentItem(String sTableID)
Default Constructor

    super("comment", POSITION_INVISIBLE, 300, sTableID);
    setRefreshInterval(INTERVAL_LIVE);
    setType(TableColumn.TYPE_TEXT);
    setObfustication(true);
    setMinWidth(50);
  
Methods Summary
public voidcellMouseTrigger(TableCellMouseEvent event)

		DownloadManager dm = (DownloadManager) event.cell.getDataSource();
		if (dm == null) {return;}
		
		event.skipCoreFunctionality = true;
		if (event.eventType != TableCellMouseEvent.EVENT_MOUSEDOUBLECLICK) {return;}
		TorrentUtil.promptUserForComment(new DownloadManager[] {dm});
	
public java.lang.StringgetObfusticatedText(TableCell cell)

		DownloadManager dm = (DownloadManager)cell.getDataSource();
		return Integer.toHexString(dm.hashCode());
	
public voidrefresh(TableCell cell)

    String comment = null;
    DownloadManager dm = (DownloadManager)cell.getDataSource();
    comment = dm.getDownloadState().getUserComment();
    if (comment != null) {
    	comment = comment.replace('\r", ' ").replace('\n", ' ");
    }
    cell.setText((comment == null) ? "" : comment);