Search in sources :

Example 1 with XMLFieldConfigEnumValueGroup

use of com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueGroup 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;
}
Also used : XMLFieldConfigEnumValueField(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueField) XMLFieldConfigString(com.sldeditor.common.xml.ui.XMLFieldConfigString) SymbolTypeConfig(com.sldeditor.ui.detail.config.symboltype.SymbolTypeConfig) XMLFieldConfigEnumValueItem(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem) XMLFieldConfigEnumValueGroup(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueGroup) FieldList(com.sldeditor.common.xml.ui.XMLFieldConfigEnumValue.FieldList)

Aggregations

FieldList (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValue.FieldList)1 XMLFieldConfigEnumValueField (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueField)1 XMLFieldConfigEnumValueGroup (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueGroup)1 XMLFieldConfigEnumValueItem (com.sldeditor.common.xml.ui.XMLFieldConfigEnumValueItem)1 XMLFieldConfigString (com.sldeditor.common.xml.ui.XMLFieldConfigString)1 SymbolTypeConfig (com.sldeditor.ui.detail.config.symboltype.SymbolTypeConfig)1