private void setupFieldKey(final String propertyName, final PropertyEditorFieldInfo fieldInfo) { fieldInfo.withKey(propertyName); }
private void setupFieldKey(final String propertyName, final PropertyEditorFieldInfo fieldInfo) { fieldInfo.withKey(propertyName); }
@Override public void addBooleanProperty(DisplayerAttributeDef attributeDef, boolean value) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, Boolean.toString(value), BOOLEAN) .withKey(attributeDef.getFullId())); }
@Override public void addBooleanProperty(DisplayerAttributeDef attributeDef, boolean value) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, Boolean.toString(value), BOOLEAN) .withKey(attributeDef.getFullId())); }
@Override public void addColorProperty(DisplayerAttributeDef attributeDef, String color) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, color, COLOR) .withKey(attributeDef.getFullId())); }
@Override public void addColorProperty(DisplayerAttributeDef attributeDef, String color) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, color, COLOR) .withKey(attributeDef.getFullId())); }
@Override public void addTextProperty(DisplayerAttributeDef attributeDef, String value, PropertyFieldValidator... validators) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, value, TEXT) .withValidators(validators) .withKey(attributeDef.getFullId())); }
@Override public void addTextProperty(DisplayerAttributeDef attributeDef, String value, PropertyFieldValidator... validators) { String propName = attrMapI18n.get(attributeDef); category.withField(new PropertyEditorFieldInfo(propName, value, TEXT) .withValidators(validators) .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())); }
@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 addTextProperty(String propId, String propName, String value, PropertyFieldValidator... validators) { category.withField(new PropertyEditorFieldInfo(propName, value, TEXT) .withValidators(validators) .withKey(propId)); }
@Override public void addTextProperty(String propId, String propName, String value, PropertyFieldValidator... validators) { category.withField(new PropertyEditorFieldInfo(propName, value, TEXT) .withValidators(validators) .withKey(propId)); }
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; }
private PropertyEditorCategory generatedPropertyEditor() { PropertyEditorCategory category = new PropertyEditorCategory(CommonConstants.INSTANCE.TargetDivConfiguration()); final Map<String, String> parameters = configContext.getComponentProperties(); String selectedID = parameters.get(ID_PARAMETER); category.withField(new PropertyEditorFieldInfo(CommonConstants.INSTANCE.TargetDivPlaceHolder(), selectedID == null ? "" : selectedID, PropertyEditorType.TEXT) .withKey(configContext.hashCode() + ID_PARAMETER)); propertyEditor.addExpandedCategory(category.getName()); return category; }
private PropertyEditorCategory generatedPropertyEditor() { PropertyEditorCategory category = new PropertyEditorCategory(CommonConstants.INSTANCE.TargetDivConfiguration()); final Map<String, String> parameters = configContext.getComponentProperties(); String selectedID = parameters.get(ID_PARAMETER); category.withField(new PropertyEditorFieldInfo(CommonConstants.INSTANCE.TargetDivPlaceHolder(), selectedID == null ? "" : selectedID, PropertyEditorType.TEXT) .withKey(configContext.hashCode() + ID_PARAMETER)); propertyEditor.addExpandedCategory(category.getName()); return category; }
@Before public void initialize() { List<PropertyEditorCategory> categories = new ArrayList<>(); category1 = new PropertyEditorCategory("c1"); category1.withField(new PropertyEditorFieldInfo("f1", "v1", PropertyEditorType.TEXT).withKey("f1")); categories.add(category1); category2 = new PropertyEditorCategory("c2"); category2.withField(new PropertyEditorFieldInfo("f2", "v2", PropertyEditorType.TEXT).withKey("f2")); categories.add(category2); when(layoutElement.getProperties()).thenReturn(elementProps); when(layoutElement.getPropertyCategories()).thenReturn(categories); presenter = new LayoutElementPropertiesPresenter(view, cssHelper, propertyChangedEvent, propertyClearAllEvent); presenter.edit(layoutElement); }