use of org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor in project nebula.widgets.nattable by eclipse.
the class EditableGridExample method registerISINValidator.
private static void registerISINValidator(IConfigRegistry configRegistry) {
TextCellEditor textCellEditor = new TextCellEditor();
textCellEditor.setErrorDecorationEnabled(true);
textCellEditor.setDecorationPositionOverride(SWT.LEFT | SWT.TOP);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, textCellEditor, DisplayMode.NORMAL, SECURITY_ID_EDITOR);
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR, getSecurtityIdValidator(), DisplayMode.EDIT, SECURITY_ID_CONFIG_LABEL);
}
use of org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor in project nebula.widgets.nattable by eclipse.
the class EditorConfiguration method registerColumnFiveIntegerEditor.
private void registerColumnFiveIntegerEditor(IConfigRegistry configRegistry) {
// register a TextCellEditor for column five that moves the selection
// after commit
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(false, true), DisplayMode.NORMAL, EditorExample.COLUMN_FIVE_LABEL);
// configure to open the adjacent editor after commit
configRegistry.registerConfigAttribute(EditConfigAttributes.OPEN_ADJACENT_EDITOR, Boolean.TRUE, DisplayMode.EDIT, EditorExample.COLUMN_FIVE_LABEL);
// configure to open always in dialog to show the tick update in normal
// mode
configRegistry.registerConfigAttribute(EditConfigAttributes.OPEN_IN_DIALOG, Boolean.TRUE, DisplayMode.EDIT, EditorExample.COLUMN_FIVE_LABEL);
// don't forget to register the Integer converter!
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultIntegerDisplayConverter(), DisplayMode.NORMAL, EditorExample.COLUMN_FIVE_LABEL);
}
use of org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor in project nebula.widgets.nattable by eclipse.
the class EditorConfiguration method registerColumnSixDoubleEditor.
private void registerColumnSixDoubleEditor(IConfigRegistry configRegistry) {
// register a TextCellEditor for column five that moves the selection
// after commit
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(false, true), DisplayMode.NORMAL, EditorExample.COLUMN_SIX_LABEL);
// configure to open the adjacent editor after commit
configRegistry.registerConfigAttribute(EditConfigAttributes.OPEN_ADJACENT_EDITOR, Boolean.TRUE, DisplayMode.EDIT, EditorExample.COLUMN_SIX_LABEL);
// configure to open always in dialog to show the tick update in normal
// mode
configRegistry.registerConfigAttribute(EditConfigAttributes.OPEN_IN_DIALOG, Boolean.TRUE, DisplayMode.EDIT, EditorExample.COLUMN_SIX_LABEL);
// configure the tick update dialog to use the adjust mode
configRegistry.registerConfigAttribute(TickUpdateConfigAttributes.USE_ADJUST_BY, Boolean.TRUE, DisplayMode.EDIT, EditorExample.COLUMN_SIX_LABEL);
// don't forget to register the Double converter!
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultDoubleDisplayConverter(), DisplayMode.NORMAL, EditorExample.COLUMN_SIX_LABEL);
}
use of org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor in project nebula.widgets.nattable by eclipse.
the class EditorConfiguration method registerColumnTwoTextEditor.
private void registerColumnTwoTextEditor(IConfigRegistry configRegistry) {
// register a TextCellEditor for column two that commits on key up/down
// moves the selection after commit by enter
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor(true, true), DisplayMode.NORMAL, EditorExample.COLUMN_TWO_LABEL);
// configure to open the adjacent editor after commit
configRegistry.registerConfigAttribute(EditConfigAttributes.OPEN_ADJACENT_EDITOR, Boolean.TRUE, DisplayMode.EDIT, EditorExample.COLUMN_TWO_LABEL);
// configure a custom message for the multi edit dialog
Map<String, Object> editDialogSettings = new HashMap<>();
editDialogSettings.put(ICellEditDialog.DIALOG_MESSAGE, "Please specify the lastname in here:");
configRegistry.registerConfigAttribute(EditConfigAttributes.EDIT_DIALOG_SETTINGS, editDialogSettings, DisplayMode.EDIT, EditorExample.COLUMN_TWO_LABEL);
}
use of org.eclipse.nebula.widgets.nattable.edit.editor.TextCellEditor in project nebula.widgets.nattable by eclipse.
the class NatTableBuilder method configureEditing.
protected void configureEditing() {
for (int colIndex = 0; colIndex < columns.length; colIndex++) {
TableColumn column = columns[colIndex];
if (column.isEditable) {
IEditor editor = column.editor;
// Column label has been registered already
String columnLabel = BODY_COLUMN_LABEL_PREFIX + colIndex;
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITABLE_RULE, editor.getEditableRule(), DisplayMode.EDIT, columnLabel);
configRegistry.registerConfigAttribute(EditConfigAttributes.DATA_VALIDATOR, editor.getValidator(), DisplayMode.EDIT, columnLabel);
switch(editor.getType()) {
case CHECKBOX:
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new CheckBoxPainter(), DisplayMode.NORMAL, columnLabel);
configRegistry.registerConfigAttribute(CellConfigAttributes.DISPLAY_CONVERTER, new DefaultBooleanDisplayConverter(), DisplayMode.NORMAL, columnLabel);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, editor.getCellEditor(), DisplayMode.NORMAL, columnLabel);
break;
case COMBO:
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new ComboBoxPainter(), DisplayMode.NORMAL, columnLabel);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, editor.getCellEditor(), DisplayMode.NORMAL, columnLabel);
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, editor.getCellEditor(), DisplayMode.EDIT, columnLabel);
break;
case TEXT:
configRegistry.registerConfigAttribute(EditConfigAttributes.CELL_EDITOR, new TextCellEditor());
break;
default:
break;
}
}
}
}
Aggregations