Search in sources :

Example 1 with ColumnDateSizer

use of com.biglybt.ui.swt.views.tableitems.ColumnDateSizer in project BiglyBT by BiglySoftware.

the class SBC_TagDiscovery method initColumns.

protected void initColumns() {
    synchronized (SBC_TagDiscovery.class) {
        if (columnsAdded) {
            return;
        }
        columnsAdded = true;
    }
    TableColumnManager tableManager = TableColumnManager.getInstance();
    tableManager.registerColumn(TagDiscovery.class, ColumnTagDiscoveryName.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTagDiscoveryName(column);
        }
    });
    tableManager.registerColumn(TagDiscovery.class, ColumnTagDiscoveryTorrent.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTagDiscoveryTorrent(column);
        }
    });
    tableManager.registerColumn(TagDiscovery.class, ColumnTagDiscoveryAddedOn.COLUMN_ID, new TableColumnCoreCreationListener() {

        @Override
        public TableColumnCore createTableColumnCore(Class<?> forDataSourceType, String tableID, String columnID) {
            return new ColumnDateSizer(TagDiscovery.class, columnID, TableColumnCreator.DATE_COLUMN_WIDTH, tableID) {
            };
        }

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTagDiscoveryAddedOn(column);
        }
    });
    tableManager.registerColumn(TagDiscovery.class, ColumnTagDiscoveryNetwork.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnTagDiscoveryNetwork(column);
        }
    });
    tableManager.setDefaultColumnNames(TABLE_TAGDISCOVERY, new String[] { ColumnTagDiscoveryName.COLUMN_ID, ColumnTagDiscoveryTorrent.COLUMN_ID, ColumnTagDiscoveryAddedOn.COLUMN_ID });
    tableManager.setDefaultSortColumnName(TABLE_TAGDISCOVERY, ColumnTagDiscoveryAddedOn.COLUMN_ID);
}
Also used : ColumnDateSizer(com.biglybt.ui.swt.views.tableitems.ColumnDateSizer) ColumnTagDiscoveryNetwork(com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryNetwork) ColumnTagDiscoveryAddedOn(com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryAddedOn) ColumnTagDiscoveryName(com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryName) TableColumn(com.biglybt.pif.ui.tables.TableColumn) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager) TableColumnCreationListener(com.biglybt.pif.ui.tables.TableColumnCreationListener) ColumnTagDiscoveryTorrent(com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryTorrent)

Example 2 with ColumnDateSizer

use of com.biglybt.ui.swt.views.tableitems.ColumnDateSizer in project BiglyBT by BiglySoftware.

the class ColumnArchiveDLDate method refresh.

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

Example 3 with ColumnDateSizer

use of com.biglybt.ui.swt.views.tableitems.ColumnDateSizer in project BiglyBT by BiglySoftware.

the class ColumnDLHistoryRemoveDate 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.getRemoveTime());
    }
}
Also used : ColumnDateSizer(com.biglybt.ui.swt.views.tableitems.ColumnDateSizer) DownloadHistory(com.biglybt.core.history.DownloadHistory) TableColumn(com.biglybt.pif.ui.tables.TableColumn)

Example 4 with ColumnDateSizer

use of com.biglybt.ui.swt.views.tableitems.ColumnDateSizer 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 5 with ColumnDateSizer

use of com.biglybt.ui.swt.views.tableitems.ColumnDateSizer 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)

Aggregations

ColumnDateSizer (com.biglybt.ui.swt.views.tableitems.ColumnDateSizer)8 TableColumn (com.biglybt.pif.ui.tables.TableColumn)7 DownloadHistory (com.biglybt.core.history.DownloadHistory)4 TableColumnCreationListener (com.biglybt.pif.ui.tables.TableColumnCreationListener)3 TableColumnManager (com.biglybt.ui.common.table.impl.TableColumnManager)3 TagDiscovery (com.biglybt.core.tag.TagDiscovery)1 DownloadStub (com.biglybt.pif.download.DownloadStub)1 DownloadStubEx (com.biglybt.pif.download.DownloadStub.DownloadStubEx)1 ColumnTagDiscoveryAddedOn (com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryAddedOn)1 ColumnTagDiscoveryName (com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryName)1 ColumnTagDiscoveryNetwork (com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryNetwork)1 ColumnTagDiscoveryTorrent (com.biglybt.ui.swt.columns.tagdiscovery.ColumnTagDiscoveryTorrent)1