Search in sources :

Example 6 with ClientUIPreferences

use of org.eclipse.scout.rt.client.ui.ClientUIPreferences in project scout.rt by eclipse.

the class AbstractColumn method initColumn.

/*
   * Runtime
   */
@Override
public void initColumn() {
    // Apply prefs only if header is enabled (because the user is not able to change or reset anything if the header is disabled)
    if (getTable() != null && getTable().isHeaderEnabled()) {
        ClientUIPreferences env = ClientUIPreferences.getInstance();
        setVisible(env.getTableColumnVisible(this, isVisible(IDimensions.VISIBLE)));
        if (!isFixedWidth()) {
            setWidth(env.getTableColumnWidth(this, getWidth()));
        }
        setVisibleColumnIndexHint(env.getTableColumnViewIndex(this, getVisibleColumnIndexHint()));
    }
    interceptInitColumn();
}
Also used : ClientUIPreferences(org.eclipse.scout.rt.client.ui.ClientUIPreferences)

Example 7 with ClientUIPreferences

use of org.eclipse.scout.rt.client.ui.ClientUIPreferences 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

ClientUIPreferences (org.eclipse.scout.rt.client.ui.ClientUIPreferences)7 INumberColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.INumberColumn)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 TreeMap (java.util.TreeMap)1 AbstractCalendar (org.eclipse.scout.rt.client.ui.basic.calendar.AbstractCalendar)1 ICalendar (org.eclipse.scout.rt.client.ui.basic.calendar.ICalendar)1 IColumn (org.eclipse.scout.rt.client.ui.basic.table.columns.IColumn)1 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)1