changeset 2453:ec120dc6279b

Issue 616. Deactivate synchron navigation item in context menu for all themes except of cross sections. flys-client/trunk@4138 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 13 Mar 2012 15:30:07 +0000
parents 0235cdb62c98
children 99bd77501188
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java
diffstat 2 files changed, 28 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Mar 08 15:39:29 2012 +0000
+++ b/flys-client/ChangeLog	Tue Mar 13 15:30:07 2012 +0000
@@ -1,3 +1,11 @@
+2012-03-13  Raimund Renkert <raimund.renkert@intevation.de>
+
+	Issue 616.
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java:
+	  Only append the synchron navigation item to context menu if the theme
+	  is a cross section.
+
 2012-03-08  Raimund Renkert <raimund.renkert@intevation.de>
 
 	Issue 563.
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Thu Mar 08 15:39:29 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/CrossSectionChartThemePanel.java	Tue Mar 13 15:30:07 2012 +0000
@@ -655,22 +655,27 @@
     protected Menu getSingleContextMenu(final ListGridRecord[] records) {
         Menu contextMenu = super.getSingleContextMenu(records);
 
-        // Synchron checking.
-        MenuItem synchronNavigationMenuItem = new MenuItem();
-        if (synchronNavigation == true) {
-            // TODO i18n
-            synchronNavigationMenuItem.setTitle("Einzeln navigieren");
+        Theme facetTheme = ((FacetRecord)records[0]).getTheme();
+        String item = facetTheme.getFacet();
+
+        if(item.equals("cross_section")) {
+            // Synchron checking.
+            MenuItem synchronNavigationMenuItem = new MenuItem();
+            if (synchronNavigation == true) {
+                // TODO i18n
+                synchronNavigationMenuItem.setTitle("Einzeln navigieren");
+            }
+            else {
+                // TODO i18n
+                synchronNavigationMenuItem.setTitle("Synchron navigieren");
+            }
+            synchronNavigationMenuItem.addClickHandler(new ClickHandler() {
+                public void onClick(MenuItemClickEvent evt) {
+                    synchronNavigation = !synchronNavigation;
+                }
+            });
+            contextMenu.addItem(synchronNavigationMenuItem);
         }
-        else {
-            // TODO i18n
-            synchronNavigationMenuItem.setTitle("Synchron navigieren");
-        }
-        synchronNavigationMenuItem.addClickHandler(new ClickHandler() {
-            public void onClick(MenuItemClickEvent evt) {
-                synchronNavigation = !synchronNavigation;
-            }
-        });
-        contextMenu.addItem(synchronNavigationMenuItem);
 
         return contextMenu;
     }

http://dive4elements.wald.intevation.org