changeset 1289:d59dcaf52796

Improved error handling if no calculation result data was found. flys-client/trunk@2879 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 04 Oct 2011 07:55:43 +0000
parents 17bff7b27052
children f4deeafa60b3
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/TableDataPanel.java
diffstat 6 files changed, 27 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Sep 30 15:20:56 2011 +0000
+++ b/flys-client/ChangeLog	Tue Oct 04 07:55:43 2011 +0000
@@ -1,3 +1,16 @@
+2011-10-04  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/FLYSConstants.java,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants.properties,
+	  src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties:
+	  Added an error message that might be used if no calculation result was
+	  found for calculation result panel.
+
+	* src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java:
+	  Improved error handling if no calculation result was found - display
+	  error message in this case.
+
 2011-09-30  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue357 (W-Info / Wasserspiegellage, Diagramm)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Fri Sep 30 15:20:56 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.java	Tue Oct 04 07:55:43 2011 +0000
@@ -354,6 +354,10 @@
 
     String error_load_artifact();
 
+    String error_no_calc_result();
+
+
+
     String bottom_edge();
 
     String top_edge();
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Fri Sep 30 15:20:56 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants.properties	Tue Oct 04 07:55:43 2011 +0000
@@ -179,10 +179,9 @@
 error_feed_q_values_invalid = Selected Q values are outside the valid range.
 error_feed_w_values_invalid = Selected W values are outside the valid range.
 error_chart_info_service = Could not fetch meta information of the chart.
-
 error_no_meta_data_found = No meta data found.
-
 error_load_artifact = Error while adding data to the current project.
+error_no_calc_result=No calculation results found.
 
 ## map related strings
 digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Fri Sep 30 15:20:56 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_de.properties	Tue Oct 04 07:55:43 2011 +0000
@@ -180,10 +180,9 @@
 error_feed_q_values_invalid = Die gew\u00e4hlten Q Werte liegen au\u00dferhalb des g\u00fcltigen Bereiches.
 error_feed_w_values_invalid = Die gew\u00e4hlten W Werte liegen au\u00dferhalb des g\u00fcltigen Bereiches.
 error_chart_info_service = Meta Informationen des Diagramms konnten nicht geladen werden.
-
 error_no_meta_data_found = Keine Meta-Daten gefunden.
-
 error_load_artifact = Fehler beim Hinzu\u00fcgen neuer Daten in das aktuelle Projekt.
+error_no_calc_result=Es wurden keine Berechnungsergebnisse gefunden.
 
 ## map related strings
 digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Fri Sep 30 15:20:56 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/FLYSConstants_en.properties	Tue Oct 04 07:55:43 2011 +0000
@@ -174,10 +174,9 @@
 error_feed_q_values_invalid = Selected Q values are outside the valid range.
 error_feed_w_values_invalid = Selected W values are outside the valid range.
 error_chart_info_service = Could not fetch meta information of the chart.
-
 error_no_meta_data_found = No meta data found.
-
 error_load_artifact = Error while adding data to the current project.
+error_no_calc_result=No calculation results found.
 
 ## map related strings
 digitize = images/digitize.png
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java	Fri Sep 30 15:20:56 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/TableDataPanel.java	Tue Oct 04 07:55:43 2011 +0000
@@ -116,8 +116,14 @@
      * @param list List if String[] containing the data.
      */
     public void setData(List list) {
-        String[] header = (String[])list.get(0);
+        if (list == null || list.size() < 2) {
+            dataTable.setEmptyMessage(MESSAGES.error_no_calc_result());
+            return;
+        }
+
+        String[] header      = (String[])list.get(0);
         String[] firstValues = (String[])list.get(1);
+
         ListGridField[] fields = new ListGridField[header.length];
         for(int i = 0; i < header.length; i++) {
             ListGridField f = new ListGridField(String.valueOf(i));

http://dive4elements.wald.intevation.org