diff flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java @ 225:9040663aee01

Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project. flys-client/trunk@1670 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 12 Apr 2011 11:01:09 +0000
parents 35094660f91a
children a13382876e5d
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Tue Apr 12 10:54:59 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Tue Apr 12 11:01:09 2011 +0000
@@ -23,6 +23,7 @@
 import de.intevation.flys.client.shared.model.User;
 
 import de.intevation.flys.client.client.Config;
+import de.intevation.flys.client.client.FLYS;
 import de.intevation.flys.client.client.FLYSConstants;
 import de.intevation.flys.client.client.event.CollectionChangeEvent;
 import de.intevation.flys.client.client.event.CollectionChangeHandler;
@@ -46,6 +47,9 @@
     protected UserCollectionsServiceAsync userCollectionsService =
         GWT.create(UserCollectionsService.class);
 
+    /** A pointer to the FLYS instance.*/
+    protected FLYS flys;
+
     /** The user whose projects should be displayed.*/
     protected User user;
 
@@ -58,7 +62,8 @@
      *
      * @param user The user.
      */
-    public ProjectList(User user) {
+    public ProjectList(FLYS flys, User user) {
+        this.flys = flys;
         this.user = user;
 
         grid = new CollectionGrid();
@@ -101,6 +106,11 @@
     }
 
 
+    public FLYS getFlys() {
+        return flys;
+    }
+
+
     /**
      * Creates a new context menu that interacts with a CollectionRecord.
      *
@@ -115,7 +125,7 @@
         MenuItem open = new MenuItem(messages.open_project());
         open.addClickHandler(new ClickHandler() {
             public void onClick(MenuItemClickEvent evt) {
-                SC.say("Open project: " + record.getName());
+                getFlys().openProject(record.getCollection().identifier());
             }
         });
 

http://dive4elements.wald.intevation.org