Search in sources :

Example 1 with DialogErrorHandling

use of org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling in project nebula.widgets.nattable by eclipse.

the class TableEditConfiguration method registerErrorHandlingStrategies.

private void registerErrorHandlingStrategies(IConfigRegistry configRegistry) {
    configRegistry.registerConfigAttribute(EditConfigAttributes.CONVERSION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, _446_EditErrorHandlingExample.COLUMN_TWO_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, _446_EditErrorHandlingExample.COLUMN_THREE_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.CONVERSION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, _446_EditErrorHandlingExample.COLUMN_FOUR_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, _446_EditErrorHandlingExample.COLUMN_FOUR_LABEL);
}
Also used : DialogErrorHandling(org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling)

Example 2 with DialogErrorHandling

use of org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling in project nebula.widgets.nattable by eclipse.

the class TableEditConfiguration method registerErrorHandlingStrategies.

private void registerErrorHandlingStrategies(IConfigRegistry configRegistry) {
    configRegistry.registerConfigAttribute(EditConfigAttributes.CONVERSION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, EditErrorHandlingExample.COLUMN_TWO_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, EditErrorHandlingExample.COLUMN_THREE_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.CONVERSION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, EditErrorHandlingExample.COLUMN_FOUR_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(), DisplayMode.EDIT, EditErrorHandlingExample.COLUMN_FOUR_LABEL);
}
Also used : DialogErrorHandling(org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling)

Example 3 with DialogErrorHandling

use of org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling in project nebula.widgets.nattable by eclipse.

the class CrossValidationDialogErrorHandling method configureRegistry.

@Override
public void configureRegistry(IConfigRegistry configRegistry) {
    configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);
    configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDateDisplayConverter(), DisplayMode.NORMAL, CrossValidationGridExample.DATE_LABEL);
    configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDateDisplayConverter(), DisplayMode.EDIT, CrossValidationGridExample.DATE_LABEL);
    // configure the validation error style
    IStyle validationErrorStyle = new Style();
    validationErrorStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_RED);
    validationErrorStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WHITE);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, validationErrorStyle, DisplayMode.NORMAL, CrossValidationGridExample.INVALID_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR, new EventDataValidator(this.bodyDataProvider), DisplayMode.EDIT, CrossValidationGridExample.DATE_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(true), DisplayMode.EDIT, CrossValidationGridExample.DATE_LABEL);
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) DialogErrorHandling(org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) DefaultDateDisplayConverter(org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter)

Example 4 with DialogErrorHandling

use of org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling in project nebula.widgets.nattable by eclipse.

the class CrossValidationDialogErrorHandling method configureRegistry.

@Override
public void configureRegistry(IConfigRegistry configRegistry) {
    configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, IEditableRule.ALWAYS_EDITABLE);
    configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDateDisplayConverter(), DisplayMode.NORMAL, _4451_CrossValidationGridExample.DATE_LABEL);
    configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDateDisplayConverter(), DisplayMode.EDIT, _4451_CrossValidationGridExample.DATE_LABEL);
    // configure the validation error style
    IStyle validationErrorStyle = new Style();
    validationErrorStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, GUIHelper.COLOR_RED);
    validationErrorStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, GUIHelper.COLOR_WHITE);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, validationErrorStyle, DisplayMode.NORMAL, _4451_CrossValidationGridExample.INVALID_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR, new EventDataValidator(this.bodyDataProvider), DisplayMode.EDIT, _4451_CrossValidationGridExample.DATE_LABEL);
    configRegistry.registerConfigAttribute(EditConfigAttributes.VALIDATION_ERROR_HANDLER, new DialogErrorHandling(true), DisplayMode.EDIT, _4451_CrossValidationGridExample.DATE_LABEL);
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) DialogErrorHandling(org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) DefaultDateDisplayConverter(org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter)

Aggregations

DialogErrorHandling (org.eclipse.nebula.widgets.nattable.edit.config.DialogErrorHandling)4 DefaultDateDisplayConverter (org.eclipse.nebula.widgets.nattable.data.convert.DefaultDateDisplayConverter)2 IStyle (org.eclipse.nebula.widgets.nattable.style.IStyle)2 Style (org.eclipse.nebula.widgets.nattable.style.Style)2