super("date_added", ALIGN_TRAIL, POSITION_INVISIBLE, 120, sTableID);
TableContextMenuItem menuReset = addContextMenuItem("MyTorrentsView.date_added.menu.reset");
menuReset.addListener(new MenuItemListener() {
public void selected(MenuItem menu, Object target) {
if (target instanceof TableRowCore) {
TableRowCore row = (TableRowCore) target;
Object dataSource = row.getDataSource(true);
if (dataSource instanceof DownloadManager) {
DownloadManager dm = (DownloadManager) dataSource;
DownloadManagerState state = dm.getDownloadState();
try {
long add_time = new File(dm.getTorrentFileName()).lastModified();
if (add_time >= 0) {
state.setLongParameter(
DownloadManagerState.PARAM_DOWNLOAD_ADDED_TIME, add_time);
}
} catch (Throwable e) {
}
}
row.getTableCell("date_added").invalidate();
}
}
});