Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 6:e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
flys-client/trunk@1314 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 11 Feb 2011 09:51:32 +0000 |
parents | |
children | a65793e08245 |
comparison
equal
deleted
inserted
replaced
5:14bf7895a2ec | 6:e2b3966b40ca |
---|---|
1 package de.intevation.flys.client.client.ui; | |
2 | |
3 import com.google.gwt.core.client.GWT; | |
4 import com.google.gwt.i18n.client.DateTimeFormat; | |
5 | |
6 import com.smartgwt.client.widgets.Window; | |
7 | |
8 import de.intevation.flys.client.shared.model.Collection; | |
9 | |
10 import de.intevation.flys.client.client.FLYSMessages; | |
11 | |
12 | |
13 /** | |
14 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | |
15 */ | |
16 public class CollectionView extends Window { | |
17 | |
18 /** The message class that provides i18n strings.*/ | |
19 FLYSMessages messages = GWT.create(FLYSMessages.class); | |
20 | |
21 /** The collection to be displayed.*/ | |
22 protected Collection collection; | |
23 | |
24 | |
25 /** | |
26 * This constructor creates a new CollectionView that is used to display the | |
27 * <i>collection</i>. | |
28 * | |
29 * @param collection The collection to be displayed. | |
30 */ | |
31 public CollectionView(Collection collection) { | |
32 this.collection = collection; | |
33 | |
34 init(); | |
35 } | |
36 | |
37 | |
38 /** | |
39 * This method handles the initial layout stuff. | |
40 */ | |
41 protected void init() { | |
42 setWidth(600); | |
43 setHeight(400); | |
44 | |
45 setCanDragResize(true); | |
46 | |
47 DateTimeFormat dtf = DateTimeFormat.getFormat(messages.date_format()); | |
48 String lastAccess = dtf.format(collection.getLastAccess()); | |
49 setTitle(lastAccess + " - " + collection.getName()); | |
50 } | |
51 } | |
52 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |