Search in sources :

Example 1 with XMLOptionGroup

use of com.sldeditor.common.xml.ui.XMLOptionGroup in project sldeditor by robward-scisys.

the class ReadPanelConfig method parseMultiOptionGroup.

/**
 * Parses the multi option group.
 *
 * @param localisationClass the localisation class
 * @param panelId the panel id
 * @param xmlMultiGroupObj the xml multi group obj
 * @return the multi option group
 */
private MultiOptionGroup parseMultiOptionGroup(Class<?> localisationClass, Class<?> panelId, XMLMultiOptionGroup xmlMultiGroupObj) {
    MultiOptionGroup multiOptionGroupConfig = new MultiOptionGroup();
    multiOptionGroupConfig.setId(xmlMultiGroupObj.getId());
    multiOptionGroupConfig.setLabel(getLocalisedText(localisationClass, xmlMultiGroupObj.getLabel()));
    multiOptionGroupConfig.setShowLabel(xmlMultiGroupObj.getShowLabel());
    multiOptionGroupConfig.setOptional(xmlMultiGroupObj.getOption());
    List<XMLOptionGroup> optionGroupList = xmlMultiGroupObj.getOptionGroup();
    for (XMLOptionGroup xmlOptionGroup : optionGroupList) {
        OptionGroup optionGroup = new OptionGroup();
        optionGroup.setId(xmlOptionGroup.getId());
        optionGroup.setLabel(getLocalisedText(localisationClass, xmlOptionGroup.getLabel()));
        optionGroup.setShowLabel(xmlOptionGroup.getShowLabel());
        List<XMLGroupConfig> xmlGroupConfigList = xmlOptionGroup.getGroup();
        if (xmlGroupConfigList != null) {
            for (XMLGroupConfig xmlGroupConfig : xmlGroupConfigList) {
                GroupConfig groupConfig = parseGroup(localisationClass, panelId, xmlGroupConfig);
                optionGroup.addGroup(groupConfig);
            }
        }
        multiOptionGroupConfig.addGroup(optionGroup);
    }
    return multiOptionGroupConfig;
}
Also used : XMLMultiOptionGroup(com.sldeditor.common.xml.ui.XMLMultiOptionGroup) OptionGroup(com.sldeditor.ui.detail.config.base.OptionGroup) MultiOptionGroup(com.sldeditor.ui.detail.config.base.MultiOptionGroup) XMLOptionGroup(com.sldeditor.common.xml.ui.XMLOptionGroup) XMLGroupConfig(com.sldeditor.common.xml.ui.XMLGroupConfig) GroupConfig(com.sldeditor.ui.detail.config.base.GroupConfig) XMLGroupConfig(com.sldeditor.common.xml.ui.XMLGroupConfig) XMLMultiOptionGroup(com.sldeditor.common.xml.ui.XMLMultiOptionGroup) MultiOptionGroup(com.sldeditor.ui.detail.config.base.MultiOptionGroup) XMLOptionGroup(com.sldeditor.common.xml.ui.XMLOptionGroup)

Aggregations

XMLGroupConfig (com.sldeditor.common.xml.ui.XMLGroupConfig)1 XMLMultiOptionGroup (com.sldeditor.common.xml.ui.XMLMultiOptionGroup)1 XMLOptionGroup (com.sldeditor.common.xml.ui.XMLOptionGroup)1 GroupConfig (com.sldeditor.ui.detail.config.base.GroupConfig)1 MultiOptionGroup (com.sldeditor.ui.detail.config.base.MultiOptionGroup)1 OptionGroup (com.sldeditor.ui.detail.config.base.OptionGroup)1