diff flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 788:dfbc6693247e

Integrated a stacked panel on the right side of the ParameterList that enables users to see calculation results and the helper panel at the same time. flys-client/trunk@2289 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 06 Jul 2011 12:31:32 +0000
parents 854312c0528c
children cd8603aaa730
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Tue Jul 05 17:28:04 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java	Wed Jul 06 12:31:32 2011 +0000
@@ -320,21 +320,15 @@
         ArtifactDescription desc = art.getArtifactDescription();
         OutputMode[] outs        = desc.getOutputModes();
 
-        fireOutputModesChangeEvent(outs);
-
         setArtifact(art);
-        clearOutputTabs();
 
-        if (parameterList.hasPanel()) {
-            parameterList.removePanel();
-        }
         Collection c = getCollection();
 
         if (outs != null && c == null) {
             User user = getFlys().getCurrentUser();
             createNewCollection(user.identifier());
         }
-        else if (outs != null && c != null) {
+        else if (c != null) {
             Config config = Config.getInstance();
             String url    = config.getServerUrl();
             String locale = config.getLocale();
@@ -407,14 +401,29 @@
 
 
     public void onOutputModesChange(OutputModesChangeEvent event) {
+        clearOutputTabs();
         OutputMode[] outs = event.getOutputModes();
 
         if (outs == null) {
             return;
         }
 
+        boolean hasCSV = false;
+
         for (OutputMode out: outs) {
             addOutputTab(out.getName(), out);
+
+            if (out instanceof ExportMode) {
+                ExportMode export = (ExportMode) out;
+
+                if (export.getFacet("csv") != null) {
+                    hasCSV = true;
+                }
+            }
+        }
+
+        if (!hasCSV) {
+            parameterList.removeTable();
         }
     }
 
@@ -428,11 +437,11 @@
         if (out instanceof ExportMode) {
             ExportMode export = (ExportMode) out;
 
-            if (export.getFacet("csv") != null) {
+            if (export.getFacet("csv") != null && !parameterList.hasTable()) {
                 TableDataPanel p = new TableDataPanel();
                 p.setUuid(collection.identifier());
                 p.setName(out.getName());
-                parameterList.setPanel (p);
+                parameterList.setTable(p);
             }
 
             return;

http://dive4elements.wald.intevation.org