changeset 554:ad2ba6e2b8bd

Added a dirty hack to display project names shorter than 30 characters. flys-client/trunk@2073 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 08 Jun 2011 07:31:01 +0000
parents c5fc3fa02edb
children 33b86f5b1168
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java
diffstat 2 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Tue Jun 07 13:58:38 2011 +0000
+++ b/flys-client/ChangeLog	Wed Jun 08 07:31:01 2011 +0000
@@ -1,3 +1,9 @@
+2011-06-08  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/ProjectList.java:
+	  Added a dirty hack to accept project names shorter than 30 characters
+	  without cutting a part from the middle.
+
 2011-06-07  Ingo Weinzierl <ingo@intevation.de>
 
 	* src/main/java/de/intevation/flys/client/client/ui/chart/PanControl.java:
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Tue Jun 07 13:58:38 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Wed Jun 08 07:31:01 2011 +0000
@@ -290,6 +290,11 @@
             public String format(Object value, ListGridRecord record, int row, int col) {
                 String n = (String) value;
                 int len  = n.length();
+
+                if (len < 30) {
+                    return n;
+                }
+
                 int sec  = len - 15;
                 return n.substring(0, 14) + "..." + n.substring(sec, len-1);
             }

http://dive4elements.wald.intevation.org