Package org.eclipse.nebula.widgets.nattable.edit.editor

Examples of org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor


         *
         * @param configRegistry
         */
        private void registerColumnTenComboBox(IConfigRegistry configRegistry) {
            // register a combobox for the city names
            ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(PersonService.getCityNames()), -1);
            comboBoxCellEditor.setFreeEdit(true);
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.EDIT,
                    _804_GlazedListsEditorExample.COLUMN_TEN_LABEL);

View Full Code Here


         *
         * @param configRegistry
         */
        private void registerColumnElevenComboBox(IConfigRegistry configRegistry) {
            // register a combobox for the city names
            ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(PersonService.getFoodList()), -1);
            comboBoxCellEditor.setMultiselect(true);
            comboBoxCellEditor.setUseCheckbox(true);

            // change the multi selection brackets that are added to the String
            // that is shown in the editor
            comboBoxCellEditor.setMultiselectTextBracket("", "");
            // register a special converter that removes the brackets in case
            // the returned value is a Collection
            // this is necessary because editing and displaying are not directly
            // coupled to each other
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.DISPLAY_CONVERTER,
                    new DefaultDisplayConverter() {

                        @Override
                        public Object canonicalToDisplayValue(
                                Object canonicalValue) {
                            if (canonicalValue instanceof Collection) {
                                // Collection.toString() will add [ and ] around
                                // the values in the Collection
                                // So by removing the leading and ending
                                // character, we remove the brackets
                                String result = canonicalValue.toString();
                                result = result.substring(1,
                                        result.length() - 1);
                                return result;
                            }
                            // if the value is not a Collection we simply let
                            // the super class do the conversion
                            // this is necessary to show single values in the
                            // ComboBox correctly
                            return super
                                    .canonicalToDisplayValue(canonicalValue);
                        }
                    }, DisplayMode.NORMAL,
                    _804_GlazedListsEditorExample.COLUMN_ELEVEN_LABEL);

            comboBoxCellEditor.setIconImage(GUIHelper.getImage("plus"));
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.EDIT,
                    _804_GlazedListsEditorExample.COLUMN_ELEVEN_LABEL);
        }
View Full Code Here

         *
         * @param configRegistry
         */
        private void registerColumnTwelveComboBox(IConfigRegistry configRegistry) {
            // register a combobox for the city names
            ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(PersonService.getDrinkList()), -1);
            comboBoxCellEditor.setFreeEdit(true);
            comboBoxCellEditor.setMultiselect(true);
            comboBoxCellEditor.setIconImage(GUIHelper.getImage("plus"));
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.EDIT,
                    _804_GlazedListsEditorExample.COLUMN_TWELVE_LABEL);

View Full Code Here

         *
         * @param configRegistry
         */
        private void registerColumnTenComboBox(IConfigRegistry configRegistry) {
            // register a combobox editor for the street names
            ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(PersonService.getStreetNames()));
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.EDIT, _447_EditorExample.COLUMN_TEN_LABEL);
        }
View Full Code Here

         *
         * @param configRegistry
         */
        private void registerColumnElevenComboBox(IConfigRegistry configRegistry) {
            // register a combobox for the city names
            ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(PersonService.getCityNames()), -1);
            comboBoxCellEditor.setFreeEdit(true);
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.EDIT, _447_EditorExample.COLUMN_ELEVEN_LABEL);

            configRegistry.registerConfigAttribute(
View Full Code Here

         *
         * @param configRegistry
         */
        private void registerColumnTwelveComboBox(IConfigRegistry configRegistry) {
            // register a combobox for the city names
            ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(PersonService.getFoodList()), -1);
            comboBoxCellEditor.setMultiselect(true);
            comboBoxCellEditor.setUseCheckbox(true);

            // change the multi selection brackets that are added to the String
            // that is shown in the editor
            comboBoxCellEditor.setMultiselectTextBracket("", "");
            // register a special converter that removes the brackets in case
            // the returned value is a Collection
            // this is necessary because editing and displaying are not directly
            // coupled to each other
            configRegistry.registerConfigAttribute(
                    CellConfigAttributes.DISPLAY_CONVERTER,
                    new DefaultDisplayConverter() {

                        @Override
                        public Object canonicalToDisplayValue(
                                Object canonicalValue) {
                            if (canonicalValue instanceof Collection) {
                                // Collection.toString() will add [ and ] around
                                // the values in the Collection
                                // So by removing the leading and ending
                                // character, we remove the brackets
                                String result = canonicalValue.toString();
                                result = result.substring(1,
                                        result.length() - 1);
                                return result;
                            }
                            // if the value is not a Collection we simply let
                            // the super class do the conversion
                            // this is necessary to show single values in the
                            // ComboBox correctly
                            return super
                                    .canonicalToDisplayValue(canonicalValue);
                        }
                    }, DisplayMode.NORMAL,
                    _447_EditorExample.COLUMN_TWELVE_LABEL);

            comboBoxCellEditor.setIconImage(GUIHelper.getImage("plus"));
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.EDIT, _447_EditorExample.COLUMN_TWELVE_LABEL);
        }
View Full Code Here

         * @param configRegistry
         */
        private void registerColumnThirteenComboBox(
                IConfigRegistry configRegistry) {
            // register a combobox for the city names
            ComboBoxCellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(PersonService.getDrinkList()), -1);
            comboBoxCellEditor.setFreeEdit(true);
            comboBoxCellEditor.setMultiselect(true);
            comboBoxCellEditor.setIconImage(GUIHelper.getImage("plus"));
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.EDIT, _447_EditorExample.COLUMN_THIRTEEN_LABEL);

            configRegistry.registerConfigAttribute(
View Full Code Here

            // register a combo box cell editor for the gender column in the
            // filter row
            // the label is set automatically to the value of
            // FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + column
            // position
            ICellEditor comboBoxCellEditor = new ComboBoxCellEditor(
                    Arrays.asList(Gender.FEMALE, Gender.MALE));
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.NORMAL,
                    FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX
                            + DataModelConstants.GENDER_COLUMN_POSITION);

            // register a combo box cell editor for the married column in the
            // filter row
            // the label is set automatically to the value of
            // FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + column
            // position
            comboBoxCellEditor = new ComboBoxCellEditor(Arrays.asList(
                    Boolean.TRUE, Boolean.FALSE));
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                    DisplayMode.NORMAL,
                    FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX
View Full Code Here

        DataLayer bodyDataLayer = (DataLayer) layerStack.getBodyDataLayer();
        natTable.registerLabelOnColumn(bodyDataLayer, columnIndex, TEST_LABEL);
        registerComboBox(
                natTable.getConfigRegistry(),
                new ComboBoxPainter(),
                new ComboBoxCellEditor(Arrays.asList(new PricingTypeBean("MN"),
                        new PricingTypeBean("AT"))));

        natTable.configure();

        // Original value
View Full Code Here

        columnLabelAccumulator.registerColumnOverrides(2,
                "TEXT_BOX_EDITOR_LABEL");

        testConfigRegistry.registerConfigAttribute(
                EditConfigAttributes.CELL_EDITOR,
                new ComboBoxCellEditor(Arrays.asList("")), EDIT,
                "COMBO_BOX_EDITOR_LABEL");
        testConfigRegistry.registerConfigAttribute(
                EditConfigAttributes.CELL_EDITOR, new TextCellEditor(), EDIT,
                "TEXT_BOX_EDITOR_LABEL");
View Full Code Here

TOP

Related Classes of org.eclipse.nebula.widgets.nattable.edit.editor.ComboBoxCellEditor

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.