Examples of PredefinedEntry


Examples of fr.soleil.lib.flyscan.model.parsing.configuration.PredefinedEntry

                    }
                }
            }

        } else if (entry instanceof PredefinedEntry) {
            PredefinedEntry predefinedEntry = (PredefinedEntry) entry;
            switch (predefinedEntry.getEntryType()) {
                case BOOL:
                    editorComponent = new CheckBox();
                    if (entry.getValue().toLowerCase().contains(TRUE.toLowerCase())) {
                        ((CheckBox) editorComponent).setSelected(true);
                    } else {
                        ((CheckBox) editorComponent).setSelected(false);
                    }
                    break;
                case DEV_STATE: {
                    List<String> possibleValues = new ArrayList<String>();
                    for (String str : possibleValuesArray) {
                        possibleValues.add(str);
                    }
                    List<String> values = new ArrayList<String>();
                    String s = entry.getValue().replace(ParsingUtil.BRACKET_OPENNING, "")
                            .replace(ParsingUtil.BRACKET_CLOSING, "").trim();
                    String[] tmp = s.split(ParsingUtil.COMMA);
                    for (String str : tmp) {
                        values.add(str);
                    }
                    editorComponent = new MultivaluedListComponent(possibleValues, values, true);

                }
                    break;
                case ENUM:
                    editorComponent = new ComboBox();
                    if (ParsingUtil.ERROR_STRATEGY.equals(paramName)) {
                        ErrorStrategy[] values = ErrorStrategy.values();
                        for (ErrorStrategy s : values) {
                            ((ComboBox) editorComponent).addItem(s.name().toLowerCase());
                        }
                        for (ErrorStrategy s : values) {
                            String value = s.name().toLowerCase();
                            if (predefinedEntry.getValue().contains(value)) {
                                for (int i = 0; i < ((ComboBox) editorComponent).getItemCount(); i++) {
                                    if (((ComboBox) editorComponent).getItemAt(i).equals(value)) {
                                        ((ComboBox) editorComponent).setSelectedIndex(i);
                                    }
                                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.