use of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter in project nebula.widgets.nattable by eclipse.
the class DefaultExportFormatter method formatForExport.
@Override
public Object formatForExport(ILayerCell cell, IConfigRegistry configRegistry) {
Object dataValue = cell.getDataValue();
IDisplayConverter displayConverter = configRegistry.getConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, cell.getDisplayMode(), cell.getConfigLabels().getLabels());
if (displayConverter == null) {
displayConverter = this.fallbackConverter;
}
return displayConverter.canonicalToDisplayValue(cell, configRegistry, dataValue);
}
use of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter in project nebula.widgets.nattable by eclipse.
the class FilterRowDataProvider method saveState.
// Load/save state
@Override
public void saveState(String prefix, Properties properties) {
Map<Integer, String> filterTextByIndex = new HashMap<Integer, String>();
for (Integer columnIndex : this.filterIndexToObjectMap.keySet()) {
final IDisplayConverter converter = this.configRegistry.getConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, DisplayMode.NORMAL, FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + columnIndex);
String filterText = getFilterStringRepresentation(this.filterIndexToObjectMap.get(columnIndex), converter);
// $NON-NLS-1$
filterText = filterText.replace("|", PIPE_REPLACEMENT);
filterTextByIndex.put(columnIndex, filterText);
}
String string = PersistenceUtils.mapAsString(filterTextByIndex);
if (!ObjectUtils.isEmpty(string)) {
properties.put(prefix + FilterRowDataLayer.PERSISTENCE_KEY_FILTER_ROW_TOKENS, string);
}
}
use of org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter in project nebula.widgets.nattable by eclipse.
the class CheckBoxPainter method convertDataType.
protected Boolean convertDataType(ILayerCell cell, IConfigRegistry configRegistry) {
if (cell.getDataValue() instanceof Boolean) {
return (Boolean) cell.getDataValue();
}
IDisplayConverter displayConverter = configRegistry.getConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, cell.getDisplayMode(), cell.getConfigLabels().getLabels());
Boolean convertedValue = null;
if (displayConverter != null) {
convertedValue = (Boolean) displayConverter.canonicalToDisplayValue(cell, configRegistry, cell.getDataValue());
}
if (convertedValue == null) {
convertedValue = Boolean.FALSE;
}
return convertedValue;
}
Aggregations