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

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


     *
     * @param configRegistry
     */
    private void registerColumnNineComboBox(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, EditorExample.COLUMN_NINE_LABEL);
    }
View Full Code Here


     *
     * @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, EditorExample.COLUMN_TEN_LABEL);

        configRegistry.registerConfigAttribute(
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, EditorExample.COLUMN_ELEVEN_LABEL);

        comboBoxCellEditor.setIconImage(GUIHelper.getImage("plus"));
        configRegistry.registerConfigAttribute(
                EditConfigAttributes.CELL_EDITOR, comboBoxCellEditor,
                DisplayMode.EDIT, EditorExample.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, EditorExample.COLUMN_TWELVE_LABEL);

        configRegistry.registerConfigAttribute(
View Full Code Here

            // when a value is selected from the combo, the object is converted
            // to a string
            // using the converter (registered below)
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR,
                    new ComboBoxCellEditor(Arrays.asList(new PricingTypeBean(
                            "MN"), new PricingTypeBean("AT"))),
                    DisplayMode.NORMAL,
                    FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

            // The pricing bean object in column is converted to using this
View Full Code Here

            // when a value is selected from the combo, the object is converted
            // to a string
            // using the converter (registered below)
            configRegistry.registerConfigAttribute(
                    EditConfigAttributes.CELL_EDITOR,
                    new ComboBoxCellEditor(Arrays.asList(new PricingTypeBean(
                            "MN"), new PricingTypeBean("AT"))),
                    DisplayMode.NORMAL,
                    FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + 4);

            // The pricing bean object in column is converted to using this
View Full Code Here

                registerCheckBoxEditor(configRegistry, new CheckBoxPainter(),
                        new CheckBoxCellEditor());
                registerComboBox(
                        configRegistry,
                        new ComboBoxPainter(),
                        new ComboBoxCellEditor(Arrays.asList(
                                new PricingTypeBean("MN"), new PricingTypeBean(
                                        "AT"))));

                registerEditableRules(configRegistry, dataProvider);
            }
View Full Code Here

            public IEditor.Type getType() {
                return Type.COMBO;
            }

            public ICellEditor getCellEditor() {
                return new ComboBoxCellEditor(dataProvider);
            }
        };
    }
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

         *
         * @param configRegistry
         */
        private void registerColumnNineComboBox(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,
                    _804_GlazedListsEditorExample.COLUMN_NINE_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.