Search in sources :

Example 6 with TableColumnManager

use of com.biglybt.ui.common.table.impl.TableColumnManager in project BiglyBT by BiglySoftware.

the class TableViewPainted method delete.

@Override
public void delete() {
    triggerLifeCycleListener(TableLifeCycleListener.EVENT_TABLELIFECYCLE_DESTROYED);
    if (tvTabsCommon != null) {
        tvTabsCommon.delete();
        tvTabsCommon = null;
    }
    TableStructureEventDispatcher.getInstance(tableID).removeListener(this);
    TableColumnManager tcManager = TableColumnManager.getInstance();
    if (tcManager != null) {
        tcManager.saveTableColumns(getDataSourceType(), tableID);
    }
    if (!Utils.isDisplayDisposed()) {
        Utils.disposeSWTObjects(new Object[] { cTable });
        cTable = null;
        if (filter != null) {
            disableFilterCheck();
        }
        removeAllTableRows();
    }
    configMan.removeParameterListener("ReOrder Delay", this);
    configMan.removeParameterListener("Graphics Update", this);
    configMan.removeParameterListener("Table.extendedErase", this);
    configMan.removeParameterListener("Table.headerHeight", this);
    Colors colorInstance = Colors.getInstance();
    if (colorInstance != null) {
        colorInstance.removeColorsChangedListener(this);
    }
    super.delete();
    MessageText.removeListener(this);
}
Also used : Colors(com.biglybt.ui.swt.mainwindow.Colors) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager)

Example 7 with TableColumnManager

use of com.biglybt.ui.common.table.impl.TableColumnManager in project BiglyBT by BiglySoftware.

the class TableColumnCreator method createCompleteDM.

public static TableColumnCore[] createCompleteDM(String tableID) {
    final String[] defaultVisibleOrder = { HealthItem.COLUMN_ID, RankItem.COLUMN_ID, "SeedingRank", NameItem.COLUMN_ID, "azsubs.ui.column.subs", "azbuddy.ui.column.msgpending", "RatingColumn", "Info", "RateIt", CommentIconItem.COLUMN_ID, SizeItem.COLUMN_ID, StatusItem.COLUMN_ID, SeedsItem.COLUMN_ID, PeersItem.COLUMN_ID, UpSpeedItem.COLUMN_ID, ShareRatioItem.COLUMN_ID, UpItem.COLUMN_ID, TrackerStatusItem.COLUMN_ID };
    TableColumnManager tcManager = TableColumnManager.getInstance();
    Map mapTCs = tcManager.getTableColumnsAsMap(DownloadTypeComplete.class, tableID);
    tcManager.setDefaultColumnNames(tableID, defaultVisibleOrder);
    if (!tcManager.loadTableColumnSettings(DownloadTypeComplete.class, tableID) || areNoneVisible(mapTCs)) {
        setVisibility(mapTCs, defaultVisibleOrder);
        RankItem tc = (RankItem) mapTCs.get(RankItem.COLUMN_ID);
        if (tc != null) {
            tcManager.setDefaultSortColumnName(tableID, RankItem.COLUMN_ID);
            tc.setSortAscending(true);
        }
    }
    return (TableColumnCore[]) mapTCs.values().toArray(new TableColumnCore[0]);
}
Also used : TableColumnCore(com.biglybt.ui.common.table.TableColumnCore) Map(java.util.Map) LightHashMap(com.biglybt.core.util.LightHashMap) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager)

Example 8 with TableColumnManager

use of com.biglybt.ui.common.table.impl.TableColumnManager in project BiglyBT by BiglySoftware.

the class TableColumnCreator method createIncompleteDM.

public static TableColumnCore[] createIncompleteDM(String tableID) {
    final String[] defaultVisibleOrder = { HealthItem.COLUMN_ID, RankItem.COLUMN_ID, NameItem.COLUMN_ID, "TorrentStream", "azsubs.ui.column.subs", "azbuddy.ui.column.msgpending", "RatingColumn", "Info", CommentIconItem.COLUMN_ID, SizeItem.COLUMN_ID, DownItem.COLUMN_ID, DoneItem.COLUMN_ID, StatusItem.COLUMN_ID, SeedsItem.COLUMN_ID, PeersItem.COLUMN_ID, DownSpeedItem.COLUMN_ID, UpSpeedItem.COLUMN_ID, ETAItem.COLUMN_ID, ShareRatioItem.COLUMN_ID, TrackerStatusItem.COLUMN_ID };
    TableColumnManager tcManager = TableColumnManager.getInstance();
    Map mapTCs = tcManager.getTableColumnsAsMap(DownloadTypeIncomplete.class, tableID);
    tcManager.setDefaultColumnNames(tableID, defaultVisibleOrder);
    if (!tcManager.loadTableColumnSettings(DownloadTypeIncomplete.class, tableID) || areNoneVisible(mapTCs)) {
        setVisibility(mapTCs, defaultVisibleOrder);
        RankItem tc = (RankItem) mapTCs.get(RankItem.COLUMN_ID);
        if (tc != null) {
            tcManager.setDefaultSortColumnName(tableID, RankItem.COLUMN_ID);
            tc.setSortAscending(true);
        }
    }
    return (TableColumnCore[]) mapTCs.values().toArray(new TableColumnCore[0]);
}
Also used : TableColumnCore(com.biglybt.ui.common.table.TableColumnCore) Map(java.util.Map) LightHashMap(com.biglybt.core.util.LightHashMap) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager)

Example 9 with TableColumnManager

use of com.biglybt.ui.common.table.impl.TableColumnManager in project BiglyBT by BiglySoftware.

the class TableManagerImpl method unregisterColumn.

@Override
public void unregisterColumn(final Class forDataSourceType, final String cellID, final TableColumnCreationListener listener) {
    TableColumnManager tcManager = TableColumnManager.getInstance();
    tcManager.unregisterColumn(forDataSourceType, cellID, listener);
    String[] tables = tcManager.getTableIDs();
    for (String tid : tables) {
        TableColumnCore col = tcManager.getTableColumnCore(tid, cellID);
        if (col != null) {
            col.remove();
        }
    }
}
Also used : TableColumnCore(com.biglybt.ui.common.table.TableColumnCore) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager)

Example 10 with TableColumnManager

use of com.biglybt.ui.common.table.impl.TableColumnManager in project BiglyBT by BiglySoftware.

the class TableManagerImpl method registerColumn.

@Override
public void registerColumn(final Class forDataSourceType, final String cellID, final TableColumnCreationListener listener) {
    TableColumnManager tcManager = TableColumnManager.getInstance();
    tcManager.registerColumn(forDataSourceType, cellID, listener);
    String[] tables = tcManager.getTableIDs();
    for (String tid : tables) {
        // we don't know which tables are affected at this point to refresh all.
        // if this proves to be a performance issue then we would have to use the
        // forDataSourceType to derive affected tables somehow
        TableStructureEventDispatcher tsed = TableStructureEventDispatcher.getInstance(tid);
        tsed.tableStructureChanged(true, forDataSourceType);
    }
}
Also used : TableStructureEventDispatcher(com.biglybt.ui.common.table.TableStructureEventDispatcher) TableColumnManager(com.biglybt.ui.common.table.impl.TableColumnManager)

Aggregations

TableColumnManager (com.biglybt.ui.common.table.impl.TableColumnManager)38 TableColumnCore (com.biglybt.ui.common.table.TableColumnCore)16 TableColumn (com.biglybt.pif.ui.tables.TableColumn)13 TableColumnCreationListener (com.biglybt.pif.ui.tables.TableColumnCreationListener)11 LightHashMap (com.biglybt.core.util.LightHashMap)4 UIManager (com.biglybt.pif.ui.UIManager)4 TableManager (com.biglybt.pif.ui.tables.TableManager)4 ISelectedContent (com.biglybt.ui.selectedcontent.ISelectedContent)3 Subscription (com.biglybt.core.subs.Subscription)2 UIInputReceiverListener (com.biglybt.pif.ui.UIInputReceiverListener)2 UIPluginViewToolBarListener (com.biglybt.pif.ui.UIPluginViewToolBarListener)2 UIFunctions (com.biglybt.ui.UIFunctions)2 TableColumnCoreCreationListener (com.biglybt.ui.common.table.TableColumnCoreCreationListener)2 TableRowCore (com.biglybt.ui.common.table.TableRowCore)2 DownloadUrlInfo (com.biglybt.ui.selectedcontent.DownloadUrlInfo)2 SWTSkinObject (com.biglybt.ui.swt.skin.SWTSkinObject)2 SWTSkinObjectContainer (com.biglybt.ui.swt.skin.SWTSkinObjectContainer)2 TableViewSWTMenuFillListener (com.biglybt.ui.swt.views.table.TableViewSWTMenuFillListener)2 ColumnDateSizer (com.biglybt.ui.swt.views.tableitems.ColumnDateSizer)2 Map (java.util.Map)2