private void fillEnumValues(final Object propertyValue, final PropertyEditorFieldInfo fieldInfo) { if (propertyValue instanceof Enum) { Enum<?>[] enumConstants = ((Enum<?>) propertyValue).getDeclaringClass().getEnumConstants(); List<String> enumValues = Arrays.stream(enumConstants).map(Object::toString).collect(Collectors.toList()); fieldInfo.withComboValues(enumValues); } }
private void generateComboValues(Field declaredField, PropertyEditorFieldInfo field) { List<String> values = new ArrayList<String>(); for (Object constant : declaredField.getType().getEnumConstants()) { values.add(constant.toString()); } field.withComboValues(values); }
private void generateComboValues(Field declaredField, PropertyEditorFieldInfo field) { List<String> values = new ArrayList<String>(); for (Object constant : declaredField.getType().getEnumConstants()) { values.add(constant.toString()); } field.withComboValues(values); }
private void fillEnumValues(final Object propertyValue, final PropertyEditorFieldInfo fieldInfo) { if (propertyValue instanceof Enum) { Enum<?>[] enumConstants = ((Enum<?>) propertyValue).getDeclaringClass().getEnumConstants(); List<String> enumValues = Arrays.stream(enumConstants).map(Object::toString).collect(Collectors.toList()); fieldInfo.withComboValues(enumValues); } }
@Override public void addListProperty(DisplayerAttributeDef attributeDef, List<String> optionList, String selectedValue) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, selectedValue, COMBO) .withComboValues(optionList) .withKey(attributeDef.getFullId())); }
@Override public void addListProperty(DisplayerAttributeDef attributeDef, List<String> optionList, String selectedValue) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, selectedValue, COMBO) .withComboValues(optionList) .withKey(attributeDef.getFullId())); }
public PropertyEditorFieldInfo createPropertyField(CssProperty property, String value) { String displayName = propertyNameMapI18n.get(property); String helpText = propertyHelpMapI18n.get(property); PropertyEditorType propType = resolveFieldType(property); List<PropertyFieldValidator> validators = getValidators(property); List<CssAllowedValue> allowedValues = property.getAllowedValues(); CssAllowedValue allowedValue = parseCssAllowedValue(property, value); String currentValue = allowedValue != null ? formatCssAllowedValue(property, allowedValue) : value; PropertyEditorFieldInfo field = new PropertyEditorFieldInfo(displayName, currentValue, propType) .withKey(property.getName()); if (helpText != null) { field.withHelpInfo("", helpText); } if (validators != null && !validators.isEmpty()) { field.withValidators(validators); } if (allowedValues != null && !allowedValues.isEmpty()) { field.withComboValues(allowedValues.stream() .map(v -> formatCssAllowedValue(property, v)) .collect(Collectors.toList())); } return field; }
public PropertyEditorFieldInfo createPropertyField(CssProperty property, String value) { String displayName = propertyNameMapI18n.get(property); String helpText = propertyHelpMapI18n.get(property); PropertyEditorType propType = resolveFieldType(property); List<PropertyFieldValidator> validators = getValidators(property); List<CssAllowedValue> allowedValues = property.getAllowedValues(); CssAllowedValue allowedValue = parseCssAllowedValue(property, value); String currentValue = allowedValue != null ? formatCssAllowedValue(property, allowedValue) : value; PropertyEditorFieldInfo field = new PropertyEditorFieldInfo(displayName, currentValue, propType) .withKey(property.getName()); if (helpText != null) { field.withHelpInfo("", helpText); } if (validators != null && !validators.isEmpty()) { field.withValidators(validators); } if (allowedValues != null && !allowedValues.isEmpty()) { field.withComboValues(allowedValues.stream() .map(v -> formatCssAllowedValue(property, v)) .collect(Collectors.toList())); } return field; }
selectedScreenId == null ? "" : selectedScreenId, PropertyEditorType.COMBO) .withComboValues(availableWorkbenchScreensIds) .withKey(configContext.hashCode() + PLACE_NAME_PARAMETER));
selectedScreenId == null ? "" : selectedScreenId, PropertyEditorType.COMBO) .withComboValues(availableWorkbenchScreensIds) .withKey(configContext.hashCode() + PLACE_NAME_PARAMETER));