use of com.sldeditor.common.xml.ui.XMLFieldConfigVendorOption in project sldeditor by robward-scisys.
the class ReadPanelConfig method parseGroup.
/**
* Parses the group if fields.
*
* @param localisationClass the localisation class
* @param panelId the panel id
* @param xmlGroupObj the xml group object
* @return the group config
*/
private GroupConfig parseGroup(Class<?> localisationClass, Class<?> panelId, XMLGroupConfig xmlGroupObj) {
GroupConfig groupConfig = new GroupConfig();
groupConfig.setId(xmlGroupObj.getId());
groupConfig.setLabel(groupTitle(getLocalisedText(localisationClass, xmlGroupObj.getLabel())));
groupConfig.setShowLabel(xmlGroupObj.getShowLabel());
groupConfig.setOptional(xmlGroupObj.getOption());
for (Object obj : xmlGroupObj.getFieldList()) {
if (obj instanceof XMLFieldConfigData) {
addField(localisationClass, panelId, groupConfig, (XMLFieldConfigData) obj);
} else if (obj instanceof XMLGroupConfig) {
GroupConfig subGroup = parseGroup(localisationClass, panelId, (XMLGroupConfig) obj);
groupConfig.addGroup(subGroup);
} else if (obj instanceof XMLMultiOptionGroup) {
MultiOptionGroup subGroup = parseMultiOptionGroup(localisationClass, panelId, (XMLMultiOptionGroup) obj);
groupConfig.addGroup(subGroup);
} else if (obj instanceof XMLFieldConfigVendorOption) {
XMLFieldConfigVendorOption vendorOption = (XMLFieldConfigVendorOption) obj;
FieldIdEnum id = vendorOption.getId();
String label = null;
boolean valueOnly = true;
FieldConfigCommonData commonData = new FieldConfigCommonData(panelId, id, label, valueOnly);
List<VendorOptionInterface> veList = null;
veList = vendorOptionFactory.getVendorOptionList(vendorOption.getClazz());
if ((veList == null) || veList.isEmpty()) {
ConsoleManager.getInstance().error(this, Localisation.getField(FieldConfigBase.class, "FieldConfigVendorOption.missingVendorOptionClass") + vendorOption.getClazz());
}
FieldConfigVendorOption placeHolder = new FieldConfigVendorOption(commonData, veList);
groupConfig.addField(placeHolder);
}
}
return groupConfig;
}
Aggregations