FileDocCategorySizeDatePackage
ColumnTitle.javaAPI DocAzureus 3.0.3.43233Mon Sep 17 18:41:38 BST 2007com.aelitis.azureus.ui.swt.columns.torrent

ColumnTitle

public class ColumnTitle extends org.gudy.azureus2.ui.swt.views.table.utils.CoreTableColumn implements org.gudy.azureus2.plugins.ui.tables.TableCellRefreshListener, org.gudy.azureus2.ui.swt.debug.ObfusticateCellText
author
TuxPaper
created
Oct 10, 2006

Fields Summary
public static String
COLUMN_ID
public static boolean
SHOW_EXT_INFO
public static String
s
Constructors Summary
public ColumnTitle(String sTableID)
Default Constructor


	   
	   
		super(COLUMN_ID, POSITION_LAST, 250, sTableID);
		setMinWidth(100);
		setObfustication(true);
		setType(TableColumn.TYPE_TEXT);
	
Methods Summary
public java.lang.StringgetObfusticatedText(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

		String name = null;
		DownloadManager dm = (DownloadManager) cell.getDataSource();
		if (dm != null) {
			name = dm.toString();
			int i = name.indexOf('#");
			if (i > 0) {
				name = name.substring(i + 1);
			}
		}

		if (name == null) {
			name = "";
		}
		return name;
	
public voidrefresh(org.gudy.azureus2.plugins.ui.tables.TableCell cell)

		String name = null;
		DownloadManager dm = (DownloadManager) cell.getDataSource();
		if (dm != null) {
			name = PlatformTorrentUtils.getContentTitle(dm.getTorrent());
			if (name == null) {
				name = dm.getDisplayName();
			}
		}
		if (name == null) {
			name = "";
		}

		if (!cell.setSortValue(name) && cell.isValid()) {
			return;
		}

		if (!cell.isShown()) {
			return;
		}

		if (SHOW_EXT_INFO && name.length() > 0) {
			String path = dm.getDownloadState().getPrimaryFile();
			if (path != null) {
				int pos = path.lastIndexOf('.");
				if (pos >= 0) {
					String ext = path.substring(pos);
					Program program = Program.findProgram(ext);
					if (program != null) {
						ext += " (" + program.getName() + ")";
					}
					name += "\n"
							+ MessageText.getString("TableColumn.header.name.ext",
									new String[] {
										ext
									});
				}
			}
		}
		cell.setText(name);