Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java @ 6:e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
flys-client/trunk@1314 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 11 Feb 2011 09:51:32 +0000 |
parents | 89976499e013 |
children | 8facd8545a12 |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Fri Feb 11 09:45:59 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java Fri Feb 11 09:51:32 2011 +0000 @@ -9,9 +9,14 @@ import de.intevation.artifacts.common.model.User; +import de.intevation.flys.client.shared.model.Collection; +import de.intevation.flys.client.shared.model.DefaultCollection; + import de.intevation.flys.client.client.services.UserService; import de.intevation.flys.client.client.services.UserServiceAsync; +import de.intevation.flys.client.client.ui.CollectionView; import de.intevation.flys.client.client.ui.FLYSView; +import de.intevation.flys.client.client.ui.FLYSWorkspace; import de.intevation.flys.client.client.ui.MainMenu; import de.intevation.flys.client.client.ui.ProjectList; @@ -35,6 +40,9 @@ /** The project list that displays the projects of the user.*/ protected ProjectList projectList; + /** The FLYSWorkspace.*/ + protected FLYSWorkspace workspace; + /** * This is the entry point method. @@ -47,7 +55,7 @@ vertical.setWidth100(); vertical.setHeight100(); - menu = new MainMenu(); + menu = new MainMenu(this); view = new FLYSView(); vertical.addMember(menu); @@ -66,9 +74,22 @@ menu.setCurrentUser(user); projectList = new ProjectList(user); + workspace = new FLYSWorkspace(); view.setProjectList(projectList); + view.setFLYSWorkspace(workspace); } }); } + + + /** + * This method creates a new CollectionView and adds it to the workspace. + */ + public void newProject() { + // TODO Call the REST service to create a new Collection + // TODO Use the UUID of the Collection to add a new CollectionView! + Collection c = new DefaultCollection(new java.util.Date().toString()); + workspace.addView(c.identifier(), new CollectionView(c)); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :