Search in sources :

Example 6 with INumberColumn

use of org.eclipse.scout.rt.client.ui.basic.table.columns.INumberColumn in project scout.rt by eclipse.

the class OrganizeColumnsForm method applyViewForConfig.

public void applyViewForConfig(String configName) {
    ClientUIPreferences prefs = ClientUIPreferences.getInstance();
    if (isCustomizable()) {
        byte[] tableCustomizerData = prefs.getTableCustomizerData(m_organizedTable.getTableCustomizer(), configName);
        if (tableCustomizerData != null) {
            m_organizedTable.getTableCustomizer().removeAllColumns();
            m_organizedTable.getTableCustomizer().setSerializedData(tableCustomizerData);
        }
        if (m_organizedTable.getReloadHandler() != null) {
            m_organizedTable.resetColumnConfiguration();
            m_organizedTable.getReloadHandler().reload();
        }
    }
    for (IColumn<?> col : m_organizedTable.getColumnSet().getColumns()) {
        col.setVisible(prefs.getTableColumnVisible(col, col.isInitialVisible(), configName));
        col.setWidth(prefs.getTableColumnWidth(col, col.getInitialWidth(), configName));
        col.setVisibleColumnIndexHint(prefs.getTableColumnViewIndex(col, col.getInitialSortIndex(), configName));
        if (col instanceof INumberColumn) {
            ((INumberColumn) col).setBackgroundEffect(prefs.getTableColumnBackgroundEffect(col, ((INumberColumn) col).getInitialBackgroundEffect(), configName));
        }
    }
}
Also used : INumberColumn(org.eclipse.scout.rt.client.ui.basic.table.columns.INumberColumn) ClientUIPreferences(org.eclipse.scout.rt.client.ui.ClientUIPreferences)

Aggregations

INumberColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.INumberColumn)6 ArrayList (java.util.ArrayList)3 TreeMap (java.util.TreeMap)3 IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)3 ClientUIPreferences (org.eclipse.scout.rt.client.ui.ClientUIPreferences)2 ColumnSet (org.eclipse.scout.rt.client.ui.basic.table.ColumnSet)2 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)2 TableColumnState (org.eclipse.scout.rt.shared.services.common.bookmark.TableColumnState)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 AbstractColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractColumn)1