changeset 1268:d0500e993218

Force a single selection in the datacage widget for DEMs and WSPs. flys-client/trunk@2821 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 26 Sep 2011 11:04:00 +0000
parents 07aa1f504491
children 45791d12a1f4
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java flys-client/src/main/java/de/intevation/flys/client/client/ui/WspDatacagePanel.java
diffstat 4 files changed, 35 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Mon Sep 26 09:08:47 2011 +0000
+++ b/flys-client/ChangeLog	Mon Sep 26 11:04:00 2011 +0000
@@ -1,3 +1,13 @@
+2011-09-26  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java:
+	  Added new method to adjust the selection type (multi or single select).
+
+	* src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java,
+	  src/main/java/de/intevation/flys/client/client/ui/WspDatacagePanel.java:
+	  Set single selection type for DatacageWidget's grid - only one selected
+	  item is allowed here.
+
 2011-09-26  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue323 (Datenkorb: Doppelklick im Datenkorb sollte gewähltes Thema (Themen) laden)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java	Mon Sep 26 09:08:47 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWidget.java	Mon Sep 26 11:04:00 2011 +0000
@@ -15,6 +15,7 @@
 import com.smartgwt.client.widgets.tree.TreeGrid;
 import com.smartgwt.client.widgets.tree.TreeNode;
 
+import com.smartgwt.client.types.SelectionStyle;
 import com.smartgwt.client.types.TreeModelType;
 
 import com.smartgwt.client.widgets.layout.VLayout;
@@ -162,6 +163,16 @@
     }
 
 
+    public void setIsMutliSelectable(boolean multi) {
+        if (multi) {
+            treeGrid.setSelectionType(SelectionStyle.MULTIPLE);
+        }
+        else {
+            treeGrid.setSelectionType(SelectionStyle.SINGLE);
+        }
+    }
+
+
     /**
      * @param handler Handler to be added (notified on add-action).
      */
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java	Mon Sep 26 09:08:47 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/DemDatacagePanel.java	Mon Sep 26 11:04:00 2011 +0000
@@ -28,6 +28,13 @@
 
 
     @Override
+    protected void createWidget() {
+        super.createWidget();
+        widget.setIsMutliSelectable(false);
+    }
+
+
+    @Override
     public User getUser() {
         return null;
     }
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/WspDatacagePanel.java	Mon Sep 26 09:08:47 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/WspDatacagePanel.java	Mon Sep 26 11:04:00 2011 +0000
@@ -59,6 +59,13 @@
     }
 
 
+    @Override
+    protected void createWidget() {
+        super.createWidget();
+        widget.setIsMutliSelectable(false);
+    }
+
+
     /**
      * We need to override this method (defined in AbstractUIProvider) because
      * we have to create a new Artifact specified by  the Datacage selection via

http://dive4elements.wald.intevation.org