changeset 253:aea3ab5997b2

Added a doubleclick listener to the project list to open a project. flys-client/trunk@1863 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 09 May 2011 10:31:54 +0000
parents 385e9368ffcd
children 6838e4112eeb
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon May 09 10:23:20 2011 +0000
+++ b/flys-client/ChangeLog	Mon May 09 10:31:54 2011 +0000
@@ -1,3 +1,9 @@
+2011-05-09  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/ProjectList.java:
+	  Added a doubleclick listener to the rows of this list. A doubleclick
+	  will now open the selected project.
+
 2011-05-09	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/shared/model/DistanceInfoRecord.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Mon May 09 10:23:20 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Mon May 09 10:31:54 2011 +0000
@@ -16,6 +16,8 @@
 import com.smartgwt.client.widgets.grid.ListGrid;
 import com.smartgwt.client.widgets.grid.ListGridField;
 import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent;
+import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler;
 import com.smartgwt.client.widgets.grid.events.RowContextClickEvent;
 import com.smartgwt.client.widgets.grid.events.RowContextClickHandler;
 import com.smartgwt.client.widgets.layout.VLayout;
@@ -98,6 +100,16 @@
 
         grid.setFields(date, name);
 
+        grid.addCellDoubleClickHandler(new CellDoubleClickHandler() {
+            public void onCellDoubleClick(CellDoubleClickEvent e) {
+                CollectionRecord record = (CollectionRecord) e.getRecord();
+                String uuid = record != null
+                    ? record.getCollection().identifier()
+                    : "";
+                getFlys().openProject(uuid);
+            }
+        });
+
         grid.addRowContextClickHandler(new RowContextClickHandler() {
             public void onRowContextClick(RowContextClickEvent event) {
                 CollectionRecord record = (CollectionRecord) event.getRecord();

http://dive4elements.wald.intevation.org