Search in sources :

Example 1 with FormulaResultDisplayConverter

use of org.eclipse.nebula.widgets.nattable.formula.FormulaResultDisplayConverter in project nebula.widgets.nattable by eclipse.

the class DefaultFormulaConfiguration method configureRegistry.

@Override
public void configureRegistry(IConfigRegistry configRegistry) {
    configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);
    // register converter to make editing of functions work
    configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new FormulaEditDisplayConverter(this.dataProvider), DisplayMode.EDIT);
    // register converter to show decimal values localized
    configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new FormulaResultDisplayConverter(this.dataProvider), DisplayMode.NORMAL, GridRegion.BODY);
    // register TextCellEditor that moves on arrow keys and enter
    configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(true, true, true));
    // register the border style to use for copy border
    IStyle copyBorderStyle = new Style();
    copyBorderStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, new BorderStyle(1, GUIHelper.COLOR_BLACK, LineStyleEnum.DASHED));
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, copyBorderStyle, DisplayMode.NORMAL, SelectionStyleLabels.COPY_BORDER_STYLE);
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) FormulaResultDisplayConverter(org.eclipse.nebula.widgets.nattable.formula.FormulaResultDisplayConverter) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle) TextCellEditor(org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor) FormulaEditDisplayConverter(org.eclipse.nebula.widgets.nattable.formula.FormulaEditDisplayConverter)

Aggregations

TextCellEditor (org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor)1 FormulaEditDisplayConverter (org.eclipse.nebula.widgets.nattable.formula.FormulaEditDisplayConverter)1 FormulaResultDisplayConverter (org.eclipse.nebula.widgets.nattable.formula.FormulaResultDisplayConverter)1 BorderStyle (org.eclipse.nebula.widgets.nattable.style.BorderStyle)1 IStyle (org.eclipse.nebula.widgets.nattable.style.IStyle)1 Style (org.eclipse.nebula.widgets.nattable.style.Style)1