Search in sources :

Example 11 with TableColumn

use of com.biglybt.pif.ui.tables.TableColumn 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 12 with TableColumn

use of com.biglybt.pif.ui.tables.TableColumn 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 13 with TableColumn

use of com.biglybt.pif.ui.tables.TableColumn in project BiglyBT by BiglySoftware.

the class ClientStatsView method initColumns.

private void initColumns(Core core) {
    synchronized (ClientStatsView.class) {
        if (columnsAdded) {
            return;
        }
        columnsAdded = true;
    }
    UIManager uiManager = PluginInitializer.getDefaultInterface().getUIManager();
    TableManager tableManager = uiManager.getTableManager();
    tableManager.registerColumn(ClientStatsDataSource.class, ColumnCS_Name.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnCS_Name(column);
        }
    });
    tableManager.registerColumn(ClientStatsDataSource.class, ColumnCS_Count.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnCS_Count(column);
        }
    });
    tableManager.registerColumn(ClientStatsDataSource.class, ColumnCS_Discarded.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnCS_Discarded(column);
        }
    });
    tableManager.registerColumn(ClientStatsDataSource.class, ColumnCS_Received.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnCS_Received(column);
        }
    });
    tableManager.registerColumn(ClientStatsDataSource.class, ColumnCS_ReceivedPer.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnCS_ReceivedPer(column);
        }
    });
    tableManager.registerColumn(ClientStatsDataSource.class, ColumnCS_Sent.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnCS_Sent(column);
        }
    });
    tableManager.registerColumn(ClientStatsDataSource.class, ColumnCS_Pct.COLUMN_ID, new TableColumnCreationListener() {

        @Override
        public void tableColumnCreated(TableColumn column) {
            new ColumnCS_Pct(column);
        }
    });
    for (final String network : AENetworkClassifier.AT_NETWORKS) {
        tableManager.registerColumn(ClientStatsDataSource.class, network + "." + ColumnCS_Sent.COLUMN_ID, new TableColumnCreationListener() {

            @Override
            public void tableColumnCreated(TableColumn column) {
                column.setUserData("network", network);
                new ColumnCS_Sent(column);
            }
        });
        tableManager.registerColumn(ClientStatsDataSource.class, network + "." + ColumnCS_Discarded.COLUMN_ID, new TableColumnCreationListener() {

            @Override
            public void tableColumnCreated(TableColumn column) {
                column.setUserData("network", network);
                new ColumnCS_Discarded(column);
            }
        });
        tableManager.registerColumn(ClientStatsDataSource.class, network + "." + ColumnCS_Received.COLUMN_ID, new TableColumnCreationListener() {

            @Override
            public void tableColumnCreated(TableColumn column) {
                column.setUserData("network", network);
                new ColumnCS_Received(column);
            }
        });
        tableManager.registerColumn(ClientStatsDataSource.class, network + "." + ColumnCS_Count.COLUMN_ID, new TableColumnCreationListener() {

            @Override
            public void tableColumnCreated(TableColumn column) {
                column.setUserData("network", network);
                new ColumnCS_Count(column);
            }
        });
    }
    TableColumnManager tcManager = TableColumnManager.getInstance();
    tcManager.setDefaultColumnNames(TABLEID, new String[] { ColumnCS_Name.COLUMN_ID, ColumnCS_Pct.COLUMN_ID, ColumnCS_Count.COLUMN_ID, ColumnCS_Received.COLUMN_ID, ColumnCS_Sent.COLUMN_ID, ColumnCS_Discarded.COLUMN_ID });
}
Also used : UIManager(com.biglybt.pif.ui.UIManager) TableColumn(com.biglybt.pif.ui.tables.TableColumn) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager) TableColumnCreationListener(com.biglybt.pif.ui.tables.TableColumnCreationListener) TableManager(com.biglybt.pif.ui.tables.TableManager)

Example 14 with TableColumn

use of com.biglybt.pif.ui.tables.TableColumn 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 15 with TableColumn

use of com.biglybt.pif.ui.tables.TableColumn 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

TableColumn (com.biglybt.pif.ui.tables.TableColumn)29 TableColumnManager (com.biglybt.ui.common.table.impl.TableColumnManager)13 TableColumnCreationListener (com.biglybt.pif.ui.tables.TableColumnCreationListener)11 ColumnDateSizer (com.biglybt.ui.swt.views.tableitems.ColumnDateSizer)7 TableColumnCore (com.biglybt.ui.common.table.TableColumnCore)5 DownloadHistory (com.biglybt.core.history.DownloadHistory)4 TableManager (com.biglybt.pif.ui.tables.TableManager)4 DownloadManager (com.biglybt.core.download.DownloadManager)2 LightHashMap (com.biglybt.core.util.LightHashMap)2 Download (com.biglybt.pif.download.Download)2 UIInputReceiverListener (com.biglybt.pif.ui.UIInputReceiverListener)2 UIManager (com.biglybt.pif.ui.UIManager)2 TableCell (com.biglybt.pif.ui.tables.TableCell)2 TableCellRefreshListener (com.biglybt.pif.ui.tables.TableCellRefreshListener)2 ChatInstance (com.biglybt.plugin.net.buddy.BuddyPluginBeta.ChatInstance)2 TableCellCore (com.biglybt.ui.common.table.TableCellCore)2 TableColumnCoreCreationListener (com.biglybt.ui.common.table.TableColumnCoreCreationListener)2 TableRowCore (com.biglybt.ui.common.table.TableRowCore)2 UISWTViewEvent (com.biglybt.ui.swt.pif.UISWTViewEvent)2 ActivitiesEntry (com.biglybt.activities.ActivitiesEntry)1