changeset 1559:d738132d64b9

Added translateable context menu to open manual point editor from themepanel. flys-client/trunk@3805 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 27 Jan 2012 14:53:39 +0000
parents eff394f9714a
children 1c47de6ccfb1
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java
diffstat 6 files changed, 43 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Jan 27 13:51:27 2012 +0000
+++ b/flys-client/ChangeLog	Fri Jan 27 14:53:39 2012 +0000
@@ -1,3 +1,14 @@
+2012-01-27  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties:
+	  Added translations for manual points related words.
+
+	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java:
+	  Added context menu to open point editor from themepanel.
+
 2012-01-27  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/chart/ChartToolbar.java,
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri Jan 27 13:51:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri Jan 27 14:53:39 2012 +0000
@@ -738,5 +738,7 @@
     String standby();
 
     String points();
+
+    String editpoints();
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri Jan 27 13:51:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri Jan 27 14:53:39 2012 +0000
@@ -385,3 +385,4 @@
 newpoint = New Point
 standby = Creating Artifact ... please wait.
 points = Points
+editpoints = Edit Points
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri Jan 27 13:51:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri Jan 27 14:53:39 2012 +0000
@@ -385,3 +385,5 @@
 newpoint = Neuer Punkt
 standby = Erstelle Parameterisierung ... bitte warten.
 points = Punktthema
+editpoints = Eintr\u00e4ge editieren
+
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri Jan 27 13:51:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri Jan 27 14:53:39 2012 +0000
@@ -384,3 +384,6 @@
 removepoint = Remove
 newpoint = New Point
 standby = Creating Artifact ... please wait.
+points = Points
+editpoints = Edit Points
+
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java	Fri Jan 27 13:51:27 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/ChartThemePanel.java	Fri Jan 27 14:53:39 2012 +0000
@@ -302,8 +302,24 @@
     }
 
 
+    /** Attach menu/item to open editor for Manual Points. */
+    protected void attachManualPointsMenu(Menu menu) {
+        menu.addItem(createSeparator());
+        MenuItem editManualPoints = new MenuItem(MSG.editpoints());
+        
+        editManualPoints.addClickHandler(new ClickHandler() {
+                public void onClick(MenuItemClickEvent evt) {
+                    new ManualPointsEditor(view.getCollection(),
+                        redrawRequestHandlers.get(0)).show();
+                }
+            });
+        menu.addItem(editManualPoints);
+    }
+
+
     /**
-     * Include area specific menu items.
+     * Include area specific menu items and manual point editor, depending
+     * on facet.
      */
     protected Menu getSingleContextMenu(final ListGridRecord[] records) {
         Menu menu = super.getSingleContextMenu(records);
@@ -311,7 +327,13 @@
         final Theme facetTheme = ((FacetRecord)records[0]).getTheme();
         String thisItem = facetTheme.getDescription();
         if (!canArea(facetTheme)) {
-            return menu;
+            if (facetTheme.getFacet().equals("manualpoints")) {
+                attachManualPointsMenu(menu);
+                return menu;
+            }
+            else {
+                return menu;
+            }
         }
         
         menu.addItem(createSeparator());

http://dive4elements.wald.intevation.org