teichmann@5861: /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde teichmann@5861: * Software engineering by Intevation GmbH teichmann@5861: * teichmann@5861: * This file is Free Software under the GNU AGPL (>=v3) teichmann@5861: * and comes with ABSOLUTELY NO WARRANTY! Check out the teichmann@5861: * documentation coming with Dive4Elements River for details. teichmann@5861: */ teichmann@5861: teichmann@5835: package org.dive4elements.river.client.client.ui; ingo@74: ingo@74: import com.smartgwt.client.widgets.Label; ingo@74: import com.smartgwt.client.widgets.tab.Tab; ingo@74: teichmann@5835: import org.dive4elements.river.client.shared.model.Artifact; teichmann@5835: import org.dive4elements.river.client.shared.model.Collection; teichmann@5835: import org.dive4elements.river.client.shared.model.OutputMode; ingo@74: ingo@74: ingo@74: public class OutputTab extends Tab { ingo@74: ingo@74: /** The OutputMode that should be displayed in this tab.*/ ingo@74: protected OutputMode mode; ingo@74: ingo@74: /** The Collection that should be displayed in this tab.*/ ingo@74: protected Collection collection; ingo@74: ingo@3549: /** The CollectionView containing this tab. */ ingo@1364: protected CollectionView collectionView; ingo@1364: ingo@74: ingo@74: /** ingo@74: * The default constructor that creates a new Tab for displaying a specific ingo@74: * OutputMode of a Collection. ingo@74: * ingo@74: * @param title The title of the tab. ingo@74: * @param collection The collection that need to be displayed. ingo@74: * @param outputmode The OutputMode that need to be displayed. ingo@74: */ ingo@1364: public OutputTab( ingo@1364: String title, ingo@1364: Collection collection, ingo@1364: CollectionView collectionView, ingo@1364: OutputMode mode ingo@1364: ) { ingo@74: super(title); ingo@74: ingo@1364: this.collection = collection; ingo@1364: this.mode = mode; ingo@1364: this.collectionView = collectionView; ingo@74: ingo@74: setPane(new Label("Implement concrete subclasses to vary the output.")); ingo@74: } ingo@883: ingo@883: ingo@1364: public CollectionView getCollectionView() { ingo@1364: return collectionView; ingo@1364: } ingo@1364: ingo@1364: ingo@883: public String getOutputName() { ingo@883: return mode.getName(); ingo@883: } ingo@1364: ingo@1364: ingo@1364: public Artifact getArtifact() { ingo@1364: return getCollectionView().getArtifact(); ingo@1364: } ingo@1400: ingo@1400: ingo@1400: public Collection getCollection() { ingo@1400: return collection; ingo@1400: } felix@1568: felix@1568: felix@1568: public OutputMode getMode() { felix@1568: return mode; felix@1568: } ingo@74: } ingo@74: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :