Search in sources :

Example 36 with IColumn

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;
    }
}
Also used : CompositeObject(org.eclipse.scout.rt.platform.util.CompositeObject) IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn) TreeMap(java.util.TreeMap)

Example 37 with IColumn

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());
}
Also used : CompositeObject(org.eclipse.scout.rt.platform.util.CompositeObject) IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn) TreeMap(java.util.TreeMap)

Example 38 with IColumn

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);
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn) ArrayList(java.util.ArrayList)

Example 39 with IColumn

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);
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)

Example 40 with IColumn

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"));
}
Also used : IColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)

Aggregations

IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)49 ArrayList (java.util.ArrayList)10 TreeMap (java.util.TreeMap)8 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)7 Test (org.junit.Test)6 ITable (org.eclipse.scout.rt.client.ui.basic.table.ITable)5 JSONObject (org.json.JSONObject)5 ITableRow (org.eclipse.scout.rt.client.ui.basic.table.ITableRow)4 IFormField (org.eclipse.scout.rt.client.ui.form.fields.IFormField)4 INumberColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.INumberColumn)3 HashMap (java.util.HashMap)2 IMenu (org.eclipse.scout.rt.client.ui.action.menu.IMenu)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 Method (java.lang.reflect.Method)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 TreeSet (java.util.TreeSet)1 ClientUIPreferences (org.eclipse.scout.rt.client.ui.ClientUIPreferences)1 IKeyStroke (org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke)1