Mercurial > dive4elements > river
annotate 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 |
rev | line source |
---|---|
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client.ui; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
3 import java.util.Date; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
4 |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 import com.google.gwt.core.client.GWT; |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
6 import com.google.gwt.i18n.client.DateTimeFormat; |
585
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
7 import com.google.gwt.user.client.Timer; |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
8 import com.google.gwt.user.client.rpc.AsyncCallback; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
10 import com.smartgwt.client.types.Alignment; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
11 import com.smartgwt.client.types.ListGridFieldType; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
12 import com.smartgwt.client.types.SortDirection; |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
13 import com.smartgwt.client.util.SC; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 import com.smartgwt.client.widgets.Canvas; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 import com.smartgwt.client.widgets.Label; |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
16 import com.smartgwt.client.widgets.grid.CellFormatter; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 import com.smartgwt.client.widgets.grid.ListGrid; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 import com.smartgwt.client.widgets.grid.ListGridField; |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
19 import com.smartgwt.client.widgets.grid.ListGridRecord; |
253
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
20 import com.smartgwt.client.widgets.grid.events.CellDoubleClickEvent; |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
21 import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler; |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
22 import com.smartgwt.client.widgets.grid.events.RowContextClickEvent; |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
23 import com.smartgwt.client.widgets.grid.events.RowContextClickHandler; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 import com.smartgwt.client.widgets.layout.VLayout; |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
25 import com.smartgwt.client.widgets.menu.Menu; |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
26 import com.smartgwt.client.widgets.menu.MenuItem; |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
27 import com.smartgwt.client.widgets.menu.events.MenuItemClickEvent; |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
28 import com.smartgwt.client.widgets.menu.events.ClickHandler; |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
29 import com.smartgwt.client.types.VerticalAlignment; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 import de.intevation.flys.client.shared.model.Collection; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 import de.intevation.flys.client.shared.model.CollectionRecord; |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
33 import de.intevation.flys.client.shared.model.User; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
35 import de.intevation.flys.client.client.Config; |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
36 import de.intevation.flys.client.client.FLYS; |
211
b92281182c6b
Removed the FLYSMessages interface and replaced it with a FLYSConstants interface - this interface has the ability to lookup i18n strings with given keys.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
97
diff
changeset
|
37 import de.intevation.flys.client.client.FLYSConstants; |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
38 import de.intevation.flys.client.client.event.CollectionChangeEvent; |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
39 import de.intevation.flys.client.client.event.CollectionChangeHandler; |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
40 import de.intevation.flys.client.client.services.UserCollectionsService; |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
41 import de.intevation.flys.client.client.services.UserCollectionsServiceAsync; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 /** |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 * The project list shows a list of projects of a specific user. |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 * |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 */ |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
49 public class ProjectList |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
50 extends VLayout |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
51 implements CollectionChangeHandler |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
52 { |
585
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
53 /** Interval to refresh the user's projects.*/ |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
54 public static final int UPDATE_INTERVAL = 30000; |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
55 |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
56 /** Min Interval to refresh the user's projects.*/ |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
57 public static final int MIN_UPDATE_INTERVAL = 5000; |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
58 |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 /** The interface that provides i18n messages. */ |
211
b92281182c6b
Removed the FLYSMessages interface and replaced it with a FLYSConstants interface - this interface has the ability to lookup i18n strings with given keys.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
97
diff
changeset
|
60 private FLYSConstants messages = GWT.create(FLYSConstants.class); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
62 /** The UserService used to retrieve information about the current user. */ |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
63 protected UserCollectionsServiceAsync userCollectionsService = |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
64 GWT.create(UserCollectionsService.class); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
65 |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
66 /** A pointer to the FLYS instance.*/ |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
67 protected FLYS flys; |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
68 |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 /** The user whose projects should be displayed.*/ |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 protected User user; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 /** The grid that contains the project rows.*/ |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 protected ListGrid grid; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 /** |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 * The default constructor that creates a new ProjectList for a specific |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 * user. |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 * |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 * @param user The user. |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 */ |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
81 public ProjectList(FLYS flys, User user) { |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
82 this.flys = flys; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 this.user = user; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
85 grid = new ListGrid(); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 initGrid(); |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
87 init(); |
585
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
88 initTimer(); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
90 updateUserCollections(); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 } |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 protected void initGrid() { |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 grid.setEmptyMessage(messages.no_projects()); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 grid.setLoadingDataMessage(messages.load_projects()); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 grid.setShowRecordComponents(true); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 grid.setShowRecordComponentsByCell(true); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
99 grid.setCanRemoveRecords(false); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
100 grid.setShowHeader(false); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
101 grid.setWidth100(); |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
102 grid.setHeight100(); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
103 grid.setSortDirection(SortDirection.DESCENDING); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
104 grid.setSortField(0); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
105 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
106 ListGridField date = buildDateField(); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
107 ListGridField name = buildNameField(); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
108 ListGridField fav = buildFavoriteField(); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
109 |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
110 grid.setFields(date, name, fav); |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
111 |
253
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
112 grid.addCellDoubleClickHandler(new CellDoubleClickHandler() { |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
113 public void onCellDoubleClick(CellDoubleClickEvent e) { |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
114 CollectionRecord record = (CollectionRecord) e.getRecord(); |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
115 String uuid = record != null |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
116 ? record.getCollection().identifier() |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
117 : ""; |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
118 getFlys().openProject(uuid); |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
119 } |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
120 }); |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
121 |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
122 grid.addRowContextClickHandler(new RowContextClickHandler() { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
123 public void onRowContextClick(RowContextClickEvent event) { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
124 CollectionRecord record = (CollectionRecord) event.getRecord(); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
125 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
126 Menu menu = createContextMenu(record); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
127 grid.setContextMenu(menu); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
128 menu.showContextMenu(); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
129 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
130 event.cancel(); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
131 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
132 }); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
133 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
134 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
135 |
585
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
136 /** |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
137 * Initializes a repeating timer that updates the user's collections. The |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
138 * interval is specified by the constant <i>UPDATE_INTERVAL</i>. |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
139 */ |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
140 protected void initTimer() { |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
141 Config config = Config.getInstance(); |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
142 int interval = config.getProjectListUpdateInterval(); |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
143 |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
144 interval = interval > MIN_UPDATE_INTERVAL ? interval : UPDATE_INTERVAL; |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
145 |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
146 GWT.log("Update project list every " + interval + " milliseconds."); |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
147 |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
148 Timer t = new Timer() { |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
149 @Override |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
150 public void run() { |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
151 updateUserCollections(); |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
152 } |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
153 }; |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
154 |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
155 t.scheduleRepeating(interval); |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
156 } |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
157 |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
158 |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
159 public FLYS getFlys() { |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
160 return flys; |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
161 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
162 |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
163 |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
164 /** |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
165 * Creates a new context menu that interacts with a CollectionRecord. |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
166 * |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
167 * @param record The selected record. |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
168 * |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
169 * @return the context menu with operations that interact with |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
170 * <i>record</i>. |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
171 */ |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
172 protected Menu createContextMenu(final CollectionRecord record) { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
173 Menu menu = new Menu(); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
174 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
175 MenuItem open = new MenuItem(messages.open_project()); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
176 open.addClickHandler(new ClickHandler() { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
177 public void onClick(MenuItemClickEvent evt) { |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
220
diff
changeset
|
178 getFlys().openProject(record.getCollection().identifier()); |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
179 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
180 }); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
181 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
182 MenuItem del = new MenuItem(messages.delete_project()); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
183 del.addClickHandler(new ClickHandler() { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
184 public void onClick(MenuItemClickEvent evt) { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
185 SC.warn("Removing projects is not implemented."); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
186 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
187 }); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
188 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
189 menu.addItem(open); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
190 menu.addItem(del); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
191 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
192 return menu; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
193 } |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
194 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
195 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
196 /** |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
197 * The init() method handles the layout stuff for this widget. |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
198 */ |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
199 protected void init() { |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
200 setWidth(300); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
201 setHeight100(); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
202 setShowResizeBar(true); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
203 setShowEdges(false); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
204 setLayoutMargin(0); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
205 setLayoutAlign(VerticalAlignment.TOP); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
206 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
207 Label title = new Label(messages.projects()); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
208 title.setHeight("20"); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
209 title.setMargin(5); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
210 title.setWidth100(); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
211 title.setStyleName("fontLightSmall"); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
212 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
213 Canvas titleWrapper = new Canvas(); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
214 titleWrapper.setStyleName("bgBlueDark"); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
215 titleWrapper.setWidth100(); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
216 titleWrapper.setHeight("20px"); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
217 titleWrapper.addChild(title); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
218 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
219 Canvas gridWrapper = new Canvas(); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
220 gridWrapper.setPadding(0); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
221 titleWrapper.setWidth100(); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
222 gridWrapper.addChild(grid); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
223 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
224 addMember(titleWrapper); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
225 addMember(gridWrapper); |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
226 } |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
227 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
228 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
229 public void onCollectionChange(CollectionChangeEvent event) { |
585
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
230 if (event.getOldValue() == null) { |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
231 updateUserCollections(); |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
232 } |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
233 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
234 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
235 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
236 protected void updateUserCollections() { |
585
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
237 GWT.log("==> ProjectList updates user collections!"); |
ab7ec931bae2
#22 Introduced a polling mechanism to refresh the projects of a user in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
554
diff
changeset
|
238 |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
239 Config config = Config.getInstance(); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
240 String url = config.getServerUrl(); |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
241 String locale = config.getLocale(); |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
242 |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
226
diff
changeset
|
243 userCollectionsService.getUserCollections(url, locale, user.identifier(), |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
244 new AsyncCallback<Collection[]>() { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
245 public void onFailure(Throwable caught) { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
246 GWT.log("Could not recieve a list of user collections."); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
247 GWT.log(caught.getMessage()); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
248 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
249 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
250 public void onSuccess(Collection[] collections) { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
251 int num = collections != null ? collections.length : 0; |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
252 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
253 GWT.log("Received " + num + " user collections."); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
254 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
255 if (num == 0) { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
256 return; |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
257 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
258 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
259 updateGrid(collections); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
260 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
261 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
262 ); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
263 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
264 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
265 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
266 protected void clearGrid() { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
267 ListGridRecord[] records = grid.getRecords(); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
268 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
269 for (ListGridRecord record: records) { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
270 grid.removeData(record); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
271 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
272 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
273 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
274 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
275 protected void updateGrid(Collection[] collections) { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
276 clearGrid(); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
277 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
278 for (Collection c: collections) { |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
279 grid.addData(new CollectionRecord(c)); |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
280 } |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
79
diff
changeset
|
281 } |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
282 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
283 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
284 /** |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
285 * Builds the field in the grid that displays the creation time of a |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
286 * project. |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
287 * |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
288 * @return the grid field. |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
289 */ |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
290 protected ListGridField buildDateField() { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
291 ListGridField date = new ListGridField("creationTime", "creationTime"); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
292 date.setType(ListGridFieldType.DATE); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
293 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
294 date.setCellFormatter(new CellFormatter() { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
295 public String format(Object value, ListGridRecord rec, int r, int c) { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
296 if (value == null) { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
297 return null; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
298 } |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
299 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
300 DateTimeFormat dtf = DateTimeFormat.getFormat( |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
301 messages.datetime_format()); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
302 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
303 return dtf.format((Date)value); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
304 } |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
305 }); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
306 |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
307 date.setWidth(100); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
308 date.setAlign(Alignment.LEFT); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
309 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
310 return date; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
311 } |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
312 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
313 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
314 /** |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
315 * Builds the field in the grid that displays the name of a project. |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
316 * |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
317 * @return the grid field. |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
318 */ |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
319 protected ListGridField buildNameField() { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
320 ListGridField name = new ListGridField("name", "name"); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
321 name.setType(ListGridFieldType.TEXT); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
322 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
323 name.setCellFormatter(new CellFormatter() { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
324 public String format(Object value, ListGridRecord record, int row, int col) { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
325 String n = (String) value; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
326 int len = n.length(); |
554
ad2ba6e2b8bd
Added a dirty hack to display project names shorter than 30 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
253
diff
changeset
|
327 |
ad2ba6e2b8bd
Added a dirty hack to display project names shorter than 30 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
253
diff
changeset
|
328 if (len < 30) { |
ad2ba6e2b8bd
Added a dirty hack to display project names shorter than 30 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
253
diff
changeset
|
329 return n; |
ad2ba6e2b8bd
Added a dirty hack to display project names shorter than 30 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
253
diff
changeset
|
330 } |
ad2ba6e2b8bd
Added a dirty hack to display project names shorter than 30 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
253
diff
changeset
|
331 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
332 int sec = len - 15; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
333 return n.substring(0, 14) + "..." + n.substring(sec, len-1); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
334 } |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
335 }); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
336 |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
337 name.setWidth(165); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
338 name.setAlign(Alignment.LEFT); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
339 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
340 return name; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
341 } |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
342 |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
343 |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
344 protected ListGridField buildFavoriteField() { |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
345 ListGridField fav = new ListGridField("ttl", "ttl"); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
346 fav.setType(ListGridFieldType.IMAGE); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
347 String base = GWT.getHostPageBaseURL(); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
348 fav.setImageURLPrefix(base + "images/"); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
349 fav.setImageURLSuffix(".png"); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
350 fav.setWidth(30); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
351 fav.setAlign(Alignment.RIGHT); |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
352 |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
353 return fav; |
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.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
585
diff
changeset
|
354 } |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
355 } |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
356 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |