Package org.eclipse.nebula.widgets.nattable.extension.builder.model

Examples of org.eclipse.nebula.widgets.nattable.extension.builder.model.IEditor


    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,
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.extension.builder.model.IEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.