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);
}
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]);
}
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]);
}
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();
}
}
}
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);
}
}
Aggregations