Search in sources :

Example 1 with TableStructureEventDispatcher

use of com.biglybt.ui.common.table.TableStructureEventDispatcher 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)

Example 2 with TableStructureEventDispatcher

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

the class TableColumnImpl method remove.

@Override
public void remove() {
    removed = true;
    TableColumnManager.getInstance().removeColumns(new TableColumnCore[] { this });
    TableStructureEventDispatcher tsed = TableStructureEventDispatcher.getInstance(sTableID);
    for (Class<?> cla : forPluginDataSourceTypes) {
        tsed.tableStructureChanged(true, cla);
    }
}
Also used : TableStructureEventDispatcher(com.biglybt.ui.common.table.TableStructureEventDispatcher)

Example 3 with TableStructureEventDispatcher

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

the class TableManagerImpl method addColumn.

@Override
public void addColumn(final TableColumn tableColumn) {
    if (!(tableColumn instanceof TableColumnImpl))
        throw (new UIRuntimeException("TableManager.addColumn(..) can only add columns created by createColumn(..)"));
    TableColumnManager.getInstance().addColumns(new TableColumnCore[] { (TableColumnCore) tableColumn });
    TableStructureEventDispatcher tsed = TableStructureEventDispatcher.getInstance(tableColumn.getTableID());
    tsed.tableStructureChanged(true, tableColumn.getForDataSourceType());
}
Also used : TableStructureEventDispatcher(com.biglybt.ui.common.table.TableStructureEventDispatcher) TableColumnImpl(com.biglybt.ui.common.table.impl.TableColumnImpl) UIRuntimeException(com.biglybt.pif.ui.UIRuntimeException)

Example 4 with TableStructureEventDispatcher

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

the class TableColumnImpl method invalidateCells.

@Override
public void invalidateCells() {
    TableStructureEventDispatcher tsed = TableStructureEventDispatcher.getInstance(sTableID);
    tsed.columnInvalidate(this);
}
Also used : TableStructureEventDispatcher(com.biglybt.ui.common.table.TableStructureEventDispatcher)

Example 5 with TableStructureEventDispatcher

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

the class TableColumnImpl method triggerColumnSizeChange.

@Override
public void triggerColumnSizeChange(int diff) {
    TableStructureEventDispatcher tsed = TableStructureEventDispatcher.getInstance(sTableID);
    tsed.columnSizeChanged(this, diff);
    if (iType == TYPE_GRAPHIC) {
        invalidateCells();
    }
}
Also used : TableStructureEventDispatcher(com.biglybt.ui.common.table.TableStructureEventDispatcher)

Aggregations

TableStructureEventDispatcher (com.biglybt.ui.common.table.TableStructureEventDispatcher)6 UIRuntimeException (com.biglybt.pif.ui.UIRuntimeException)1 TableColumnImpl (com.biglybt.ui.common.table.impl.TableColumnImpl)1 TableColumnManager (com.biglybt.ui.common.table.impl.TableColumnManager)1