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@1: ingo@1: import com.smartgwt.client.widgets.Canvas; ingo@4: import com.smartgwt.client.widgets.layout.HLayout; ingo@1: ingo@1: ingo@1: /** ingo@3549: * Vertically speaking the main part of the ui (containing projectlist ingo@3549: * and workspace). ingo@1: * @author Ingo Weinzierl ingo@1: */ ingo@1: public class FLYSView extends Canvas { ingo@1: ingo@4: /** The project list displaying the projects of a user.*/ ingo@4: protected ProjectList projectList; ingo@4: ingo@6: /** The workspace that handles the artifact collection views.*/ ingo@6: protected FLYSWorkspace workspace; ingo@6: ingo@4: /** The layout provided by this widget.*/ ingo@4: protected HLayout layout; ingo@4: ingo@4: ingo@4: /** ingo@4: * The default constructor for creating a new empty FLYSView. After creating ingo@4: * the components, {@link init()} is called to do the layout work. ingo@4: */ ingo@1: public FLYSView() { ingo@4: layout = new HLayout(); ingo@4: ingo@1: init(); ingo@1: } ingo@1: ingo@1: ingo@4: /** ingo@4: * This method is called to do the layout work. ingo@4: */ ingo@1: protected void init() { ingo@1: setWidth("100%"); ingo@1: setHeight("*"); ingo@1: raimund@79: setStyleName("bgWhite"); ingo@1: setBorder("1px solid #808080"); raimund@79: raimund@79: layout.setHeight("100%"); raimund@79: layout.setWidth("100%"); ingo@1: ingo@4: addChild(layout); ingo@4: } ingo@4: ingo@4: ingo@4: /** ingo@4: * Set the current project list. Previous ProjectLists are replaced by the ingo@4: * new one. ingo@4: */ ingo@4: public void setProjectList(ProjectList projectList) { ingo@4: if (this.projectList != null) { ingo@4: removeChild(this.projectList); ingo@4: } ingo@4: ingo@4: this.projectList = projectList; ingo@4: layout.addMember(this.projectList); ingo@1: } ingo@6: ingo@6: ingo@6: /** ingo@6: * Set the current FLYSWorkspace. Previous workspaces are replaced by the ingo@6: * new one. ingo@6: * ingo@6: * @param workspaces The new FLYSWorkspace. ingo@6: */ ingo@6: public void setFLYSWorkspace(FLYSWorkspace workspace) { ingo@6: if (this.workspace != null) { ingo@6: removeChild(this.workspace); ingo@6: } ingo@6: ingo@6: this.workspace = workspace; ingo@6: layout.addMember(this.workspace); ingo@6: } ingo@1: } ingo@1: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :