ColumnTitlepublic 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
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.String | getObfusticatedText(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 void | refresh(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);
|
|