Search in sources :

Example 1 with InternalTableRow

use of org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow in project scout.rt by eclipse.

the class AbstractTable method discardDeletedRows.

@Override
public void discardDeletedRows(Collection<? extends ITableRow> deletedRows) {
    if (deletedRows != null) {
        for (ITableRow row : deletedRows) {
            m_deletedRows.remove(new CompositeObject(getRowKeys(row)));
            ((InternalTableRow) row).setTableInternal(null);
        }
    }
}
Also used : CompositeObject(org.eclipse.scout.rt.platform.util.CompositeObject) InternalTableRow(org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow)

Example 2 with InternalTableRow

use of org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow in project scout.rt by eclipse.

the class AbstractTable method addCellObserver.

/**
 * Add InternalTableRow as an observer to the cell in order to update the row status on changes
 */
private void addCellObserver(List<InternalTableRow> rows) {
    for (InternalTableRow row : rows) {
        for (int i = 0; i < row.getCellCount(); i++) {
            Cell cell = row.getCellForUpdate(i);
            cell.setObserver(row);
        }
    }
}
Also used : InternalTableRow(org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow) Cell(org.eclipse.scout.rt.client.ui.basic.cell.Cell) ICell(org.eclipse.scout.rt.client.ui.basic.cell.ICell)

Example 3 with InternalTableRow

use of org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow in project scout.rt by eclipse.

the class AbstractTable method processDecorationBuffer.

/**
 * Affects columns with lookup calls or code types<br>
 * cells that have changed values fetch new texts/decorations from the lookup service in one single batch call lookup
 * (performance optimization)
 */
private void processDecorationBuffer() {
    /*
     * update row decorations
     */
    Map<Integer, Set<ITableRow>> changes = m_rowValueChangeBuffer;
    m_rowValueChangeBuffer = new HashMap<>();
    applyRowValueChanges(changes);
    Set<ITableRow> set = m_rowDecorationBuffer;
    m_rowDecorationBuffer = new HashSet<ITableRow>();
    applyRowDecorations(set);
    /*
     * check row filters
     */
    if (m_rowFilters.size() > 0) {
        boolean filterChanged = false;
        for (ITableRow row : set) {
            if (row.getTable() == AbstractTable.this && row instanceof InternalTableRow) {
                InternalTableRow irow = (InternalTableRow) row;
                boolean oldFlag = irow.isFilterAccepted();
                applyRowFiltersInternal(irow);
                boolean newFlag = irow.isFilterAccepted();
                filterChanged = filterChanged || (oldFlag != newFlag);
            }
        }
        if (filterChanged) {
            fireRowFilterChanged();
        }
    }
}
Also used : Set(java.util.Set) TreeSet(java.util.TreeSet) LinkedHashSet(java.util.LinkedHashSet) HashSet(java.util.HashSet) InternalTableRow(org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow)

Aggregations

InternalTableRow (org.eclipse.scout.rt.client.ui.basic.table.internal.InternalTableRow)3 HashSet (java.util.HashSet)1 LinkedHashSet (java.util.LinkedHashSet)1 Set (java.util.Set)1 TreeSet (java.util.TreeSet)1 Cell (org.eclipse.scout.rt.client.ui.basic.cell.Cell)1 ICell (org.eclipse.scout.rt.client.ui.basic.cell.ICell)1 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)1