ingo@3: package de.intevation.flys.client.shared.model; ingo@3: ingo@3: import java.util.Date; ingo@3: ingo@3: import com.smartgwt.client.widgets.grid.ListGridRecord; ingo@3: ingo@3: ingo@3: /** ingo@3: * The CollectionRecord is a wrapper to put Collection objects into a ListGrid. ingo@3: * ingo@3: * @author Ingo Weinzierl ingo@3: */ ingo@3: public class CollectionRecord extends ListGridRecord { ingo@3: ingo@3: /** The artifact collection. */ ingo@3: protected Collection collection; ingo@3: ingo@3: ingo@3: /** ingo@3: * The default constructor. ingo@3: * ingo@3: * @param collection The artifact collection. ingo@3: */ ingo@3: public CollectionRecord(Collection collection) { ingo@3: this.collection = collection; ingo@3: } ingo@3: ingo@3: ingo@3: /** ingo@97: * Returns the date of the creation. ingo@3: * ingo@97: * @return the creation time. ingo@3: */ ingo@97: public Date getCreationTime() { ingo@97: return collection.getCreationTime(); ingo@3: } ingo@3: ingo@3: ingo@3: /** ingo@3: * Returns the name of the collection. ingo@3: * ingo@3: * @return the name of the collection. ingo@3: */ ingo@3: public String getName() { ingo@97: String name = collection.getName(); ingo@97: return name != null && name.length() > 0 ingo@97: ? name ingo@97: : collection.identifier(); ingo@3: } ingo@222: ingo@222: ingo@222: public Collection getCollection() { ingo@222: return collection; ingo@222: } ingo@3: } ingo@3: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :