use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class ColumnSet method calculateDisplayableIndexes.
private void calculateDisplayableIndexes() {
int viewIndex = 0;
Map<CompositeObject, Integer> displayableMap = new TreeMap<CompositeObject, Integer>();
for (int modelIndex = 0; modelIndex < getColumnCount(); modelIndex++) {
IColumn col = getColumn(modelIndex);
if (col.isDisplayable()) {
displayableMap.put(new CompositeObject(modelIndex), modelIndex);
}
}
m_displayableIndexes = new int[displayableMap.size()];
viewIndex = 0;
for (int modelIndex : displayableMap.values()) {
m_displayableIndexes[viewIndex++] = modelIndex;
}
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class ColumnSet method getAllColumnsInUserOrder.
public List<IColumn<?>> getAllColumnsInUserOrder() {
List<IColumn<?>> visibleCols = getVisibleColumns();
int counter = 0;
TreeMap<CompositeObject, IColumn<?>> sortMap = new TreeMap<CompositeObject, IColumn<?>>();
for (IColumn col : visibleCols) {
counter++;
sortMap.put(new CompositeObject(col.getVisibleColumnIndexHint(), counter), col);
}
for (IColumn<?> column : getColumns()) {
if (column.isDisplayable() && column.isVisible()) {
// already in map
} else {
counter++;
sortMap.put(new CompositeObject(column.getVisibleColumnIndexHint(), counter), column);
}
}
return CollectionUtility.arrayList(sortMap.values());
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class ColumnSet method clearPermanentHeadSortColumns.
public void clearPermanentHeadSortColumns() {
if (m_permanentHeadSortColumns.size() == 0) {
return;
}
List<IColumn<?>> currentColumnList = new ArrayList<IColumn<?>>(m_permanentHeadSortColumns);
m_permanentHeadSortColumns.clear();
for (IColumn col : currentColumnList) {
HeaderCell cell = (HeaderCell) col.getHeaderCell();
cell.setSortActive(false);
cell.setSortPermanent(false);
cell.setGroupingActive(false);
}
for (IColumn col : currentColumnList) {
rebuildHeaderCell(col);
}
fireColumnHeadersUpdated(currentColumnList);
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class TableRowDataMapper method importTableRowData.
@Override
public void importTableRowData(ITableRow row, AbstractTableRowData rowData) {
for (IColumn column : m_columnSet.getColumns()) {
if (m_ignoredColumns.contains(column)) {
continue;
}
Object value = getValue(column, rowData);
column.importValue(row, value);
}
row.setStatus(rowData.getRowState());
importCustomValues(row, rowData);
}
use of org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn in project scout.rt by eclipse.
the class JsonTable method handleColumnAggregationFunctionChanged.
protected void handleColumnAggregationFunctionChanged(JsonEvent event) {
addTableEventFilterCondition(TableEvent.TYPE_COLUMN_AGGREGATION_CHANGED);
IColumn column = extractColumn(event.getData());
Assertions.assertInstance(column, INumberColumn.class, "Aggregation can only be specified on numeric columns");
getModel().getUIFacade().fireAggregationFunctionChanged((INumberColumn<?>) column, event.getData().getString("aggregationFunction"));
}
Aggregations