use of org.eclipse.nebula.widgets.nattable.filterrow.event.FilterAppliedEvent in project nebula.widgets.nattable by eclipse.
the class FilterRowDataProvider method loadState.
@Override
public void loadState(String prefix, Properties properties) {
this.filterIndexToObjectMap.clear();
try {
Object property = properties.get(prefix + FilterRowDataLayer.PERSISTENCE_KEY_FILTER_ROW_TOKENS);
Map<Integer, String> filterTextByIndex = PersistenceUtils.parseString(property);
for (Integer columnIndex : filterTextByIndex.keySet()) {
final IDisplayConverter converter = this.configRegistry.getConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, DisplayMode.NORMAL, FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + columnIndex);
String filterText = filterTextByIndex.get(columnIndex);
// $NON-NLS-1$
filterText = filterText.replace(PIPE_REPLACEMENT, "|");
this.filterIndexToObjectMap.put(columnIndex, getFilterFromString(filterText, converter));
}
} catch (Exception e) {
// $NON-NLS-1$
LOG.error("Error while restoring filter row text!", e);
}
this.filterStrategy.applyFilter(this.filterIndexToObjectMap);
this.columnHeaderLayer.fireLayerEvent(new FilterAppliedEvent(this.columnHeaderLayer));
}
use of org.eclipse.nebula.widgets.nattable.filterrow.event.FilterAppliedEvent in project nebula.widgets.nattable by eclipse.
the class FilterRowDataProvider method clearAllFilters.
/**
* Clear all filters that are currently applied.
*/
public void clearAllFilters() {
this.filterIndexToObjectMap.clear();
this.filterStrategy.applyFilter(this.filterIndexToObjectMap);
this.columnHeaderLayer.fireLayerEvent(new FilterAppliedEvent(this.columnHeaderLayer));
}
use of org.eclipse.nebula.widgets.nattable.filterrow.event.FilterAppliedEvent in project nebula.widgets.nattable by eclipse.
the class FilterRowDataProvider method setDataValue.
@Override
public void setDataValue(int columnIndex, int rowIndex, Object newValue) {
if (ObjectUtils.isNotNull(newValue)) {
this.filterIndexToObjectMap.put(columnIndex, newValue);
} else {
this.filterIndexToObjectMap.remove(columnIndex);
}
this.filterStrategy.applyFilter(this.filterIndexToObjectMap);
this.columnHeaderLayer.fireLayerEvent(new FilterAppliedEvent(this.columnHeaderLayer));
}
Aggregations