Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java @ 587:53ad6dd2cb2b
The project list displays the favorite state of a collection now. A gold star means, that a collection is a owner's favorite project and will never die. A silver star means, that the project is a common project.
flys-client/trunk@2181 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 21 Jun 2011 16:22:39 +0000 |
parents | ab7ec931bae2 |
children | 14e5e51a7de4 |
comparison
equal
deleted
inserted
replaced
586:e3c8e045737b | 587:53ad6dd2cb2b |
---|---|
103 grid.setSortDirection(SortDirection.DESCENDING); | 103 grid.setSortDirection(SortDirection.DESCENDING); |
104 grid.setSortField(0); | 104 grid.setSortField(0); |
105 | 105 |
106 ListGridField date = buildDateField(); | 106 ListGridField date = buildDateField(); |
107 ListGridField name = buildNameField(); | 107 ListGridField name = buildNameField(); |
108 | 108 ListGridField fav = buildFavoriteField(); |
109 grid.setFields(date, name); | 109 |
110 grid.setFields(date, name, fav); | |
110 | 111 |
111 grid.addCellDoubleClickHandler(new CellDoubleClickHandler() { | 112 grid.addCellDoubleClickHandler(new CellDoubleClickHandler() { |
112 public void onCellDoubleClick(CellDoubleClickEvent e) { | 113 public void onCellDoubleClick(CellDoubleClickEvent e) { |
113 CollectionRecord record = (CollectionRecord) e.getRecord(); | 114 CollectionRecord record = (CollectionRecord) e.getRecord(); |
114 String uuid = record != null | 115 String uuid = record != null |
301 | 302 |
302 return dtf.format((Date)value); | 303 return dtf.format((Date)value); |
303 } | 304 } |
304 }); | 305 }); |
305 | 306 |
306 date.setWidth(105); | 307 date.setWidth(100); |
307 date.setAlign(Alignment.LEFT); | 308 date.setAlign(Alignment.LEFT); |
308 | 309 |
309 return date; | 310 return date; |
310 } | 311 } |
311 | 312 |
331 int sec = len - 15; | 332 int sec = len - 15; |
332 return n.substring(0, 14) + "..." + n.substring(sec, len-1); | 333 return n.substring(0, 14) + "..." + n.substring(sec, len-1); |
333 } | 334 } |
334 }); | 335 }); |
335 | 336 |
336 name.setWidth(195); | 337 name.setWidth(165); |
337 name.setAlign(Alignment.LEFT); | 338 name.setAlign(Alignment.LEFT); |
338 | 339 |
339 return name; | 340 return name; |
341 } | |
342 | |
343 | |
344 protected ListGridField buildFavoriteField() { | |
345 ListGridField fav = new ListGridField("ttl", "ttl"); | |
346 fav.setType(ListGridFieldType.IMAGE); | |
347 String base = GWT.getHostPageBaseURL(); | |
348 fav.setImageURLPrefix(base + "images/"); | |
349 fav.setImageURLSuffix(".png"); | |
350 fav.setWidth(30); | |
351 fav.setAlign(Alignment.RIGHT); | |
352 | |
353 return fav; | |
340 } | 354 } |
341 } | 355 } |
342 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 356 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |