param.setDescription(paramDescription); String itemValue = ((Element)items.item(j)).getElementsByTagName(VALUE).item(0).getTextContent(); param.getValue().put(itemName, itemValue);
configuration.getParameters().add(new ConfigurationParameterListImpl(name, null)); } else if (cls.isAssignableFrom(Map.class)) { configuration.getParameters().add(new ConfigurationParameterMapImpl(name, null)); } else { logger.warn("Ignoring unsupported configurationParameter class [" + cls.getName() + "]."); configuration.getParameters().add(new ConfigurationParameterListImpl(name, (List) value)); } else if (value instanceof Map) { configuration.getParameters().add(new ConfigurationParameterMapImpl(name, (Map) value)); } else { logger.warn("Ignoring unsupported configurationParameter class [" + value.getClass().getName() + "].");
paramLayout.setColumnExpandRatio(1, .75f); Label label = new Label(parameter.getName()); label.setIcon(VaadinIcons.COG); label.addStyleName(ValoTheme.LABEL_LARGE); paramLayout.setComponentAlignment(label, Alignment.TOP_LEFT); final Map<String, String> valueMap = parameter.getValue(); mapLayout.addComponent(valueLabel, 2, i); mapLayout.addComponent(valueField, 3, i); final String mapKey = parameter.getName() + i; TextFieldKeyValuePair pair = new TextFieldKeyValuePair(); pair.key = keyField; descriptionTextField.setRows(4); descriptionTextField.setWidth("80%"); descriptionTextField.setId(parameter.getName()); paramLayout.setComponentAlignment(paramDescriptionLabel, Alignment.TOP_RIGHT); descriptionTextFields.put(parameter.getName(), descriptionTextField); if(parameter.getDescription() != null) descriptionTextField.setValue(parameter.getDescription());
paramLayout.setColumnExpandRatio(1, .75f); final Map<String, String> valueMap = parameter.getValue(); mapLayout.setComponentAlignment(valueLabel, Alignment.MIDDLE_RIGHT); mapLayout.addComponent(valueField, 3, i); final String mapKey = parameter.getName() + i; TextFieldKeyValuePair pair = new TextFieldKeyValuePair(); pair.key = keyField;
@Override public String getConfigurationValue(String paramName) { PlatformConfigurationConfiguredResource platformConfigurationConfiguredResource = new PlatformConfigurationConfiguredResource(); Configuration configuration = this.configurationManagement.getConfiguration(platformConfigurationConfiguredResource); final List<ConfigurationParameter> parameters = (List<ConfigurationParameter>)configuration.getParameters(); ConfigurationParameterMapImpl parameterMap = null; for(ConfigurationParameter parameter: parameters) { if(parameter instanceof ConfigurationParameterMapImpl) { parameterMap = (ConfigurationParameterMapImpl)parameter; } } if(parameterMap == null) { throw new RuntimeException("Cannot resolve the platform configuration map containing the platform configuration!"); } return parameterMap.getValue().get(paramName) == null ? "":parameterMap.getValue().get(paramName); }
mapLayout.addComponent(valueField, 3, mapLayout.getRows() -2); final String mapKey = parameter.getName() + mapTextFields.size(); TextFieldKeyValuePair pair = new TextFieldKeyValuePair(); pair.key = keyField;
paramLayout.setColumnExpandRatio(1, .75f); final Map<String, String> valueMap = parameter.getValue(); mapLayout.setComponentAlignment(valueLabel, Alignment.MIDDLE_RIGHT); mapLayout.addComponent(valueField, 3, i); final String mapKey = parameter.getName() + i; TextFieldKeyValuePair pair = new TextFieldKeyValuePair(); pair.key = keyField;
@Override public void saveConfigurationValue(String paramName, String value) { PlatformConfigurationConfiguredResource platformConfigurationConfiguredResource = new PlatformConfigurationConfiguredResource(); Configuration configuration = this.configurationManagement.getConfiguration(platformConfigurationConfiguredResource); final List<ConfigurationParameter> parameters = (List<ConfigurationParameter>)configuration.getParameters(); ConfigurationParameterMapImpl parameterMap = null; for(ConfigurationParameter parameter: parameters) { if(parameter instanceof ConfigurationParameterMapImpl) { parameterMap = (ConfigurationParameterMapImpl)parameter; } } if(parameterMap == null) { throw new RuntimeException("Cannot resolve the platform configuration map containing the platform configuration!"); } parameterMap.getValue().put(paramName, value); this.configurationManagement.saveConfiguration(configuration); }
mapLayout.addComponent(valueField, 3, mapLayout.getRows() -2); final String mapKey = parameter.getName() + mapTextFields.size(); TextFieldKeyValuePair pair = new TextFieldKeyValuePair(); pair.key = keyField;
mapLayout.addComponent(valueField, 3, mapLayout.getRows() -2); final String mapKey = parameter.getName() + mapTextFields.size(); TextFieldKeyValuePair pair = new TextFieldKeyValuePair(); pair.key = keyField;