changeset 777:3b02a798d75d

#181 Repaired activate/deactivate function in theme list. flys-client/trunk@2265 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 29 Jun 2011 07:59:46 +0000
parents b82bed27429f
children e14dc5fed6bb
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java
diffstat 2 files changed, 10 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Jun 28 15:55:56 2011 +0000
+++ b/flys-client/ChangeLog	Wed Jun 29 07:59:46 2011 +0000
@@ -1,3 +1,12 @@
+2011-06-29  Ingo Weinzierl <ingo@intevation.de>
+
+	flys/issue181 (Erstes Thema in der Themenliste wählt sich automatisch wieder an)
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java:
+	  We will no longer check if an update of the theme list is necessary.
+	  The EditEvent that is caught should be enough information to start the
+	  update process.
+
 2011-06-28  Ingo Weinzierl <ingo@intevation.de>
 
 	* pom.xml: GWT version upgrade from 2.1.1 to 2.3.0.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java	Tue Jun 28 15:55:56 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java	Wed Jun 29 07:59:46 2011 +0000
@@ -238,45 +238,7 @@
         Theme theme = rec.getTheme();
         theme.setActive(rec.getActive());
 
-        updateThemeList(rec.getTheme());
-    }
-
-
-    /**
-     * Update the theme list of the current collection with a modified theme. If
-     * a theme is really modified, the CollectionAttributeService is triggered
-     * to save the changes to the artifact server.
-     *
-     * @param theme The modified theme.
-     */
-    protected void updateThemeList(Theme theme) {
-        GWT.log("Update theme: " + theme.getFacet());
-
-        ThemeList themeList = getThemeList();
-
-        String a = theme.getArtifact();
-        String f = theme.getFacet();
-
-        int num = themeList != null ? themeList.getThemeCount() : 0;
-
-        boolean updateRequired = false;
-
-        for (int i = 1; i <= num; i++) {
-            Theme old = themeList.getThemeAt(i);
-
-            if (f.equals(old.getFacet()) && a.equals(old.getArtifact())) {
-                themeList.removeTheme(old);
-                themeList.addTheme(theme);
-
-                updateRequired = true;
-
-                break;
-            }
-        }
-
-        if (updateRequired) {
-            updateCollection();
-        }
+        updateCollection();
     }
 
 

http://dive4elements.wald.intevation.org