use of com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem in project sldeditor by robward-scisys.
the class ReadPanelConfig method parseSymbolTypeConfig.
/**
* Parses the symbol type configuration.
*
* @param localisationClass the localisation class
* @param panelId the panel id
* @param valueObj the value obj
* @return the symbol type config
*/
public static SymbolTypeConfig parseSymbolTypeConfig(Class<?> localisationClass, Class<?> panelId, XMLFieldConfigEnumValue valueObj) {
SymbolTypeConfig config = new SymbolTypeConfig(panelId);
String groupName = valueObj.getGroupName();
boolean isSeparateGroup = valueObj.getSeparateGroup();
if (groupName != null) {
config.setGroupName(groupName);
}
config.setSeparateGroup(isSeparateGroup);
for (XMLFieldConfigEnumValueItem itemObj : valueObj.getItem()) {
config.addOption(itemObj.getId(), getLocalisedText(localisationClass, itemObj.getLabel()));
}
FieldList fieldList = valueObj.getFieldList();
if (fieldList != null) {
for (XMLFieldConfigEnumValueField field : fieldList.getField()) {
config.addField(field.getId(), field.getEnabled());
}
for (XMLFieldConfigEnumValueGroup group : fieldList.getGroup()) {
config.addGroup(group.getId(), group.getEnabled());
}
}
return config;
}
use of com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem in project sldeditor by robward-scisys.
the class ReadMapUnits method parseSymbolTypeConfig.
/**
* Parses the symbol type configuration.
*
* @param localisationClass the localisation class
* @param panelId the panel id
* @param valueObj the value obj
* @return the symbol type config
*/
public static SymbolTypeConfig parseSymbolTypeConfig(Class<?> localisationClass, Class<?> panelId, XMLFieldConfigEnumValue valueObj) {
SymbolTypeConfig config = new SymbolTypeConfig(panelId);
String groupName = valueObj.getGroupName();
boolean isSeparateGroup = valueObj.getSeparateGroup();
if (groupName != null) {
config.setGroupName(groupName);
}
config.setSeparateGroup(isSeparateGroup);
for (XMLFieldConfigEnumValueItem itemObj : valueObj.getItem()) {
config.addOption(itemObj.getId(), getLocalisedText(localisationClass, itemObj.getLabel()));
}
FieldList fieldList = valueObj.getFieldList();
if (fieldList != null) {
for (XMLFieldConfigEnumValueField field : fieldList.getField()) {
config.addField(field.getId(), field.getEnabled());
}
}
return config;
}
Aggregations