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();
}
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));
}
}
}
Aggregations