diff flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionGrid.java @ 97:0bec0112c8b3

Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list. flys-client/trunk@1610 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 29 Mar 2011 13:53:24 +0000
parents 89976499e013
children b92281182c6b
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionGrid.java	Tue Mar 29 13:49:04 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionGrid.java	Tue Mar 29 13:53:24 2011 +0000
@@ -56,12 +56,15 @@
     protected Canvas createDateField(ListGridRecord record) {
         CollectionRecord rec = (CollectionRecord) record;
 
-        Date date          = rec.getDate();
-        DateTimeFormat dtf = DateTimeFormat.getFormat(messages.date_format());
+        Date date          = rec.getCreationTime();
+        DateTimeFormat dtf = DateTimeFormat.getFormat(
+            messages.datetime_format());
+
         String formatted   = dtf.format(date);
 
         Label label = new Label(formatted);
         label.setHeight(15);
+        label.setWidth100();
 
         return label;
     }
@@ -75,8 +78,14 @@
     protected Canvas createNameField(ListGridRecord record) {
         CollectionRecord rec = (CollectionRecord) record;
 
-        Label label = new Label(rec.getName());
+        String name = rec.getName();
+        int len     = name.length();
+        int sec     = len - 15;
+        String sub  = name.substring(0, 14) + "..." + name.substring(sec, len-1);
+
+        Label label = new Label(sub);
         label.setHeight(15);
+        label.setWidth100();
 
         return label;
     }
@@ -91,7 +100,6 @@
     protected Canvas createPublishField(ListGridRecord record) {
         IButton button = new IButton();
         button.setHeight(15);
-        button.setWidth(30);
         button.setTitle("PUB");
         return button;
     }
@@ -106,7 +114,6 @@
     protected Canvas createDeleteField(ListGridRecord record) {
         IButton button = new IButton();
         button.setHeight(15);
-        button.setWidth(30);
         button.setTitle("DEL");
         return button;
     }

http://dive4elements.wald.intevation.org