use of io.jmix.ui.component.presentation.TablePresentationsLayout in project jmix by jmix-framework.
the class AbstractTableSettingsBinder method applySettings.
@Override
public void applySettings(Table table, SettingsWrapper wrapper) {
TableSettings tableSettings = wrapper.getSettings();
if (tableSettings.getTextSelection() != null) {
table.setTextSelectionEnabled(tableSettings.getTextSelection());
com.vaadin.ui.Component presentationsLayout = getEnhancedTable(table).getPresentationsLayout();
if (presentationsLayout != null) {
((TablePresentationsLayout) presentationsLayout).updateTextSelection();
}
}
List<TableSettings.ColumnSettings> columnSettings = tableSettings.getColumns();
if (columnSettings != null) {
boolean refreshWasEnabled = getEnhancedTable(table).disableContentBufferRefreshing();
Collection<String> modelIds = new ArrayList<>();
for (Object column : getVTable(table).getVisibleColumns()) {
modelIds.add(String.valueOf(column));
}
Collection<String> loadedIds = new ArrayList<>();
for (TableSettings.ColumnSettings column : columnSettings) {
loadedIds.add(column.getId());
}
if (CollectionUtils.isEqualCollection(modelIds, loadedIds)) {
applyColumnSettings(tableSettings, table);
}
getEnhancedTable(table).enableContentBufferRefreshing(refreshWasEnabled);
}
}
Aggregations