Search in sources :

Example 1 with DownloadNameItem

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

the class PeersViewBase method initYourTableView.

protected TableViewSWT<PEPeer> initYourTableView(String table_id, boolean enable_tabs) {
    if (table_id == TableManager.TABLE_TORRENT_PEERS) {
        tv = TableViewFactory.createTableViewSWT(Peer.class, TableManager.TABLE_TORRENT_PEERS, getPropertiesPrefix(), basicItems, "pieces", SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
    } else {
        TableColumnCore[] items = PeersView.getBasicColumnItems(TableManager.TABLE_ALL_PEERS);
        TableColumnCore[] basicItems = new TableColumnCore[items.length + 1];
        System.arraycopy(items, 0, basicItems, 0, items.length);
        basicItems[items.length] = new DownloadNameItem(TableManager.TABLE_ALL_PEERS);
        TableColumnManager tcManager = TableColumnManager.getInstance();
        tcManager.setDefaultColumnNames(TableManager.TABLE_ALL_PEERS, basicItems);
        tv = TableViewFactory.createTableViewSWT(Peer.class, TableManager.TABLE_ALL_PEERS, getPropertiesPrefix(), basicItems, "connected_time", SWT.MULTI | SWT.FULL_SELECTION | SWT.VIRTUAL);
    }
    tv.setRowDefaultHeightEM(1);
    tv.setEnableTabViews(enable_tabs, true, null);
    UIFunctionsSWT uiFunctions = UIFunctionsManagerSWT.getUIFunctionsSWT();
    if (uiFunctions != null) {
        UISWTInstance pluginUI = uiFunctions.getUISWTInstance();
        registerPluginViews(table_id, pluginUI);
    }
    tv.addLifeCycleListener(this);
    tv.addMenuFillListener(this);
    tv.addSelectionListener(this, false);
    return tv;
}
Also used : Peer(com.biglybt.pif.peers.Peer) PEPeer(com.biglybt.core.peer.PEPeer) DownloadNameItem(com.biglybt.ui.swt.views.tableitems.peers.DownloadNameItem) UIFunctionsSWT(com.biglybt.ui.swt.UIFunctionsSWT) TableColumnCore(com.biglybt.ui.common.table.TableColumnCore) UISWTInstance(com.biglybt.ui.swt.pif.UISWTInstance) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager)

Aggregations

PEPeer (com.biglybt.core.peer.PEPeer)1 Peer (com.biglybt.pif.peers.Peer)1 TableColumnCore (com.biglybt.ui.common.table.TableColumnCore)1 TableColumnManager (com.biglybt.ui.common.table.impl.TableColumnManager)1 UIFunctionsSWT (com.biglybt.ui.swt.UIFunctionsSWT)1 UISWTInstance (com.biglybt.ui.swt.pif.UISWTInstance)1 DownloadNameItem (com.biglybt.ui.swt.views.tableitems.peers.DownloadNameItem)1