Search in sources :

Example 6 with DownloadHistory

use of com.biglybt.core.history.DownloadHistory in project BiglyBT by BiglySoftware.

the class ColumnDLHistoryAddDate method refresh.

@Override
public void refresh(TableCell cell) {
    TableColumn tc = cell.getTableColumn();
    if (tc instanceof ColumnDateSizer) {
        DownloadHistory dl = (DownloadHistory) cell.getDataSource();
        ((ColumnDateSizer) tc).refresh(cell, dl.getAddTime());
    }
}
Also used : ColumnDateSizer(com.biglybt.ui.swt.views.tableitems.ColumnDateSizer) DownloadHistory(com.biglybt.core.history.DownloadHistory) TableColumn(com.biglybt.pif.ui.tables.TableColumn)

Example 7 with DownloadHistory

use of com.biglybt.core.history.DownloadHistory in project BiglyBT by BiglySoftware.

the class ColumnDLHistoryCompleteDate method refresh.

@Override
public void refresh(TableCell cell) {
    TableColumn tc = cell.getTableColumn();
    if (tc instanceof ColumnDateSizer) {
        DownloadHistory dl = (DownloadHistory) cell.getDataSource();
        long time = dl.getCompleteTime();
        if (time <= 0) {
            // incomplete - force sort to be above completed ones
            time = Long.MAX_VALUE;
        }
        ((ColumnDateSizer) tc).refresh(cell, time);
    }
}
Also used : ColumnDateSizer(com.biglybt.ui.swt.views.tableitems.ColumnDateSizer) DownloadHistory(com.biglybt.core.history.DownloadHistory) TableColumn(com.biglybt.pif.ui.tables.TableColumn)

Example 8 with DownloadHistory

use of com.biglybt.core.history.DownloadHistory in project BiglyBT by BiglySoftware.

the class ColumnDLHistoryHash method refresh.

@Override
public void refresh(TableCell cell) {
    DownloadHistory dl = (DownloadHistory) cell.getDataSource();
    byte[] hash = null;
    if (dl != null) {
        hash = dl.getTorrentHash();
    }
    String str = hash == null ? "" : ByteFormatter.encodeString(hash);
    if (!cell.setSortValue(str) && cell.isValid()) {
        return;
    }
    if (!cell.isShown()) {
        return;
    }
    cell.setText(str);
}
Also used : DownloadHistory(com.biglybt.core.history.DownloadHistory)

Example 9 with DownloadHistory

use of com.biglybt.core.history.DownloadHistory in project BiglyBT by BiglySoftware.

the class ColumnDLHistoryName method refresh.

@Override
public void refresh(TableCell cell) {
    DownloadHistory dl = (DownloadHistory) cell.getDataSource();
    String name = null;
    if (dl != null) {
        name = dl.getName();
    }
    if (name == null) {
        name = "";
    }
    if (!cell.setSortValue(name) && cell.isValid()) {
        return;
    }
    if (!cell.isShown()) {
        return;
    }
    cell.setText(name);
}
Also used : DownloadHistory(com.biglybt.core.history.DownloadHistory)

Example 10 with DownloadHistory

use of com.biglybt.core.history.DownloadHistory in project BiglyBT by BiglySoftware.

the class ColumnDLHistorySaveLocation method refresh.

@Override
public void refresh(TableCell cell) {
    DownloadHistory dl = (DownloadHistory) cell.getDataSource();
    String sl = null;
    if (dl != null) {
        sl = dl.getSaveLocation();
    }
    if (sl == null) {
        sl = "";
    }
    if (!cell.setSortValue(sl) && cell.isValid()) {
        return;
    }
    if (!cell.isShown()) {
        return;
    }
    cell.setText(sl);
}
Also used : DownloadHistory(com.biglybt.core.history.DownloadHistory)

Aggregations

DownloadHistory (com.biglybt.core.history.DownloadHistory)11 TableColumn (com.biglybt.pif.ui.tables.TableColumn)3 ColumnDateSizer (com.biglybt.ui.swt.views.tableitems.ColumnDateSizer)3 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)2 DownloadHistoryEvent (com.biglybt.core.history.DownloadHistoryEvent)1 DownloadHistoryListener (com.biglybt.core.history.DownloadHistoryListener)1 UIPluginViewToolBarListener (com.biglybt.pif.ui.UIPluginViewToolBarListener)1 TableColumnCreationListener (com.biglybt.pif.ui.tables.TableColumnCreationListener)1 UserPrompterResultListener (com.biglybt.ui.UserPrompterResultListener)1 TableViewSWTMenuFillListener (com.biglybt.ui.swt.views.table.TableViewSWTMenuFillListener)1 File (java.io.File)1 Event (org.eclipse.swt.widgets.Event)1 Listener (org.eclipse.swt.widgets.Listener)1 MenuItem (org.eclipse.swt.widgets.MenuItem)1