/* * (C) Copyright 2010 Nuxeo SA (http://nuxeo.com/) and others. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Contributors: * Anahide Tchertchian */ package org.nuxeo.ecm.platform.forms.layout.descriptors; import java.io.Serializable; import java.util.HashMap; import java.util.Map; import org.nuxeo.common.xmap.annotation.XNode; import org.nuxeo.common.xmap.annotation.XNodeMap; import org.nuxeo.common.xmap.annotation.XObject; import org.nuxeo.ecm.platform.forms.layout.api.WidgetSelectOption; import org.nuxeo.ecm.platform.forms.layout.api.impl.WidgetSelectOptionImpl; /** * @author Anahide Tchertchian * @since 5.4.2 */ @XObject("option") public class WidgetSelectOptionDescriptor { @XNode("@value") protected String value; @XNode("@var") protected String var; @XNode("@itemLabel") protected String itemLabel; @XNodeMap(value = "itemLabel", key = "@locale", type = HashMap.class, componentType = String.class) protected Map<String, String> itemLabels = new HashMap<String, String>(); @XNode("@itemValue") protected String itemValue; @XNode("@itemDisabled") protected String itemDisabled; @XNode("@itemRendered") protected String itemRendered; public Serializable getValue() { return value; } public String getVar() { return var; } public String getItemLabel() { return itemLabel; } public String getItemValue() { return itemValue; } public Serializable getItemDisabled() { return itemDisabled; } public Serializable getItemRendered() { return itemRendered; } public WidgetSelectOption getWidgetSelectOption() { WidgetSelectOptionImpl res = new WidgetSelectOptionImpl(value, var, itemLabel, itemValue, itemDisabled, itemRendered); res.setItemLabels(itemLabels); return res; } }