ingo@12: package de.intevation.flys.client.shared.model; ingo@12: ingo@12: ingo@12: /** ingo@12: * The default implementation of a {@link Data} item. This class just implements ingo@12: * constructors to create instances and the necessary methods of the interface. ingo@12: * ingo@12: * @author Ingo Weinzierl ingo@12: */ ingo@12: public class DefaultData implements Data { ingo@12: ingo@12: /** The label of this Data object.*/ ingo@12: protected String label; ingo@12: ingo@12: /** The description.*/ ingo@12: protected String description; ingo@12: ingo@12: /** The type.*/ ingo@12: protected String type; ingo@12: ingo@12: /** The DataItems.*/ ingo@12: protected DataItem[] items; ingo@12: ingo@514: /** The default DataItem.*/ ingo@514: protected DataItem defaultItem; ingo@514: ingo@12: ingo@12: public DefaultData() { ingo@12: } ingo@12: ingo@12: ingo@12: /** ingo@12: * The default constructor to create new DefaultData objects. ingo@12: * ingo@12: * @param label The label. ingo@12: * @param description The description. ingo@12: * @param type The type. ingo@12: * @param items The DataItems. ingo@12: */ ingo@12: public DefaultData( ingo@22: String label, ingo@22: String description, ingo@22: String type, ingo@51: DataItem[] items) ingo@12: { ingo@514: this(label, description, type, items, null); ingo@514: } ingo@514: ingo@514: ingo@514: /** ingo@514: * The constructor to create new DefaultData objects with a default value. ingo@514: * ingo@514: * @param label The label. ingo@514: * @param description The description. ingo@514: * @param type The type. ingo@514: * @param items The DataItems. ingo@514: * @param defaultItem The default DataItem. ingo@514: */ ingo@514: public DefaultData( ingo@514: String label, ingo@514: String description, ingo@514: String type, ingo@514: DataItem[] items, ingo@514: DataItem defaultItem) ingo@514: { ingo@12: this.label = label; ingo@12: this.description = description; ingo@12: this.type = type; ingo@12: this.items = items; ingo@514: this.defaultItem = defaultItem; ingo@12: } ingo@12: ingo@12: ingo@12: public String getLabel() { ingo@12: return label; ingo@12: } ingo@12: ingo@12: ingo@12: public String getDescription() { ingo@12: return description; ingo@12: } ingo@12: ingo@12: ingo@12: public String getType() { ingo@12: return type; ingo@12: } ingo@12: ingo@12: ingo@12: public DataItem[] getItems() { ingo@12: return items; ingo@12: } ingo@514: ingo@514: ingo@514: public DataItem getDefault() { ingo@514: return defaultItem; ingo@514: } ingo@12: } ingo@12: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :