Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java @ 847:25a4bf390757
Loading recommendations: If no reference artifact is given use current
artifact as master artifact.
flys-client/trunk@2581 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 25 Aug 2011 13:36:06 +0000 |
parents | e14dc5fed6bb |
children | f343b4c2d135 |
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; |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
4 import java.util.Map; |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
5 import java.util.MissingResourceException; |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
6 |
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
|
7 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
|
8 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
|
9 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
|
10 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
|
11 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
12 import com.smartgwt.client.types.Alignment; |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
13 import com.smartgwt.client.types.ListGridEditEvent; |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
14 import com.smartgwt.client.types.ListGridFieldType; |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
15 import com.smartgwt.client.types.SelectionStyle; |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
16 import com.smartgwt.client.types.SortArrow; |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
17 import com.smartgwt.client.types.SortDirection; |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
18 import com.smartgwt.client.util.BooleanCallback; |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
19 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
|
20 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
|
21 import com.smartgwt.client.widgets.Label; |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
22 import com.smartgwt.client.widgets.grid.CellFormatter; |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
23 import com.smartgwt.client.widgets.grid.HoverCustomizer; |
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.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
|
25 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
|
26 import com.smartgwt.client.widgets.grid.ListGridRecord; |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
27 import com.smartgwt.client.widgets.grid.events.CellClickEvent; |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
28 import com.smartgwt.client.widgets.grid.events.CellClickHandler; |
253
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
29 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
|
30 import com.smartgwt.client.widgets.grid.events.CellDoubleClickHandler; |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
31 import com.smartgwt.client.widgets.grid.events.EditCompleteEvent; |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
32 import com.smartgwt.client.widgets.grid.events.EditCompleteHandler; |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
33 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
|
34 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
|
35 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
|
36 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
|
37 import com.smartgwt.client.widgets.menu.MenuItem; |
778
e14dc5fed6bb
Reordered delete and rename in project context menu, add separator.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
613
diff
changeset
|
38 import com.smartgwt.client.widgets.menu.MenuItemSeparator; |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
39 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
|
40 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
|
41 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
|
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 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
|
44 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
|
45 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
|
46 |
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
|
47 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
|
48 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
|
49 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
|
50 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
|
51 import de.intevation.flys.client.client.event.CollectionChangeHandler; |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
52 import de.intevation.flys.client.client.services.DeleteCollectionService; |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
53 import de.intevation.flys.client.client.services.DeleteCollectionServiceAsync; |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
54 import de.intevation.flys.client.client.services.SetCollectionNameService; |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
55 import de.intevation.flys.client.client.services.SetCollectionNameServiceAsync; |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
56 import de.intevation.flys.client.client.services.SetCollectionTTLService; |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
57 import de.intevation.flys.client.client.services.SetCollectionTTLServiceAsync; |
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
|
58 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
|
59 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
|
60 |
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 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 /** |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 * 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
|
64 * |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 * @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
|
66 */ |
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
|
67 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
|
68 extends VLayout |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
69 implements CollectionChangeHandler, EditCompleteHandler |
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
|
70 { |
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
|
71 /** 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
|
72 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
|
73 |
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
|
74 /** 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
|
75 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
|
76 |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
77 /** The initial width of this panel.*/ |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
78 public static final int MIN_WIDTH = 300; |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
79 |
613
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
80 /** The max length for new project names.*/ |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
81 public static final int MAX_NAME_LENGTH = 50; |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
82 |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
83 public static final String COLUMN_DATE_WIDTH = "100px"; |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
84 |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
85 public static final String COLUMN_TITLE_WIDTH = "*"; |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
86 |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
87 public static final String COLUMN_FAVORITE_WIDTH = "75px"; |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
88 |
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 /** 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
|
90 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
|
91 |
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
|
92 /** 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
|
93 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
|
94 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
|
95 |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
96 /** The service used to set the name of a project.*/ |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
97 protected SetCollectionNameServiceAsync nameService = |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
98 GWT.create(SetCollectionNameService.class); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
99 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
100 /** The service used to set the name of a project.*/ |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
101 protected SetCollectionTTLServiceAsync ttlService = |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
102 GWT.create(SetCollectionTTLService.class); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
103 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
104 /** The service used to set the name of a project.*/ |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
105 protected DeleteCollectionServiceAsync deleteService = |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
106 GWT.create(DeleteCollectionService.class); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
107 |
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
|
108 /** 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
|
109 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
|
110 |
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
|
111 /** 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
|
112 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
|
113 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
114 /** 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
|
115 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
|
116 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
117 /** |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
118 * 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
|
119 * 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
|
120 * |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
121 * @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
|
122 */ |
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
|
123 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
|
124 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
|
125 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
|
126 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
127 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
|
128 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
|
129 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
|
130 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
|
131 |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
132 grid.addEditCompleteHandler(this); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
133 |
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
|
134 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
|
135 } |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
136 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
137 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
138 protected void initGrid() { |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
139 grid.setWidth100(); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
140 grid.setHeight100(); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
141 grid.setAutoFitMaxWidth(500); |
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
|
142 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
|
143 grid.setLoadingDataMessage(messages.load_projects()); |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
144 grid.setCanEdit(false); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
145 grid.setEditEvent(ListGridEditEvent.NONE); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
146 grid.setShowHeaderContextMenu(false); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
147 grid.setShowSortArrow(SortArrow.NONE); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
148 grid.setSortDirection(SortDirection.DESCENDING); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
149 grid.setSortField(0); |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
150 grid.setSelectionType(SelectionStyle.SINGLE); |
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
|
151 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
152 ListGridField date = buildDateField(); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
153 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
|
154 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
|
155 |
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
|
156 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
|
157 |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
158 // add a handler to set / unset the favorite state of a project |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
159 grid.addCellClickHandler(new CellClickHandler() { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
160 public void onCellClick(CellClickEvent event) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
161 if (event.getColNum() != 2) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
162 return; |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
163 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
164 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
165 CollectionRecord r = (CollectionRecord) event.getRecord(); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
166 Collection c = r.getCollection(); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
167 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
168 c.setTTL(c.getTTL() == 0 ? -1 : 0); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
169 updateCollectionTTL(c); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
170 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
171 }); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
172 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
173 // add a handler to open a project |
253
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
174 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
|
175 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
|
176 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
|
177 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
|
178 ? 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
|
179 : ""; |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
180 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
|
181 } |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
182 }); |
aea3ab5997b2
Added a doubleclick listener to the project list to open a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
183 |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
184 // add a handler to open a context menu |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
185 grid.addRowContextClickHandler(new RowContextClickHandler() { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
186 public void onRowContextClick(RowContextClickEvent event) { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
187 CollectionRecord record = (CollectionRecord) event.getRecord(); |
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 menu = createContextMenu(record); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
190 grid.setContextMenu(menu); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
191 menu.showContextMenu(); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
192 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
193 event.cancel(); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
194 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
195 }); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
196 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
197 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
198 |
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
|
199 /** |
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
|
200 * 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
|
201 * 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
|
202 */ |
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
|
203 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
|
204 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
|
205 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
|
206 |
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
|
207 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
|
208 |
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
|
209 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
|
210 |
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
|
211 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
|
212 @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
|
213 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
|
214 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
|
215 } |
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
|
216 }; |
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
|
217 |
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
|
218 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
|
219 } |
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
|
220 |
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
|
221 |
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
|
222 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
|
223 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
|
224 } |
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
|
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
|
226 |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
227 /** |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
228 * 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
|
229 * |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
230 * @param record The selected record. |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
231 * |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
232 * @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
|
233 * <i>record</i>. |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
234 */ |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
235 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
|
236 Menu menu = new Menu(); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
237 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
238 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
|
239 open.addClickHandler(new ClickHandler() { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
240 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
|
241 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
|
242 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
243 }); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
244 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
245 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
|
246 del.addClickHandler(new ClickHandler() { |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
247 public void onClick(MenuItemClickEvent evt) { |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
248 SC.ask(messages.really_delete(), new BooleanCallback() { |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
249 public void execute(Boolean value) { |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
250 if (value) { |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
251 deleteCollection(record.getCollection()); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
252 } |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
253 } |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
254 }); |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
255 } |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
256 }); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
257 |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
258 MenuItem rename = new MenuItem(messages.rename_project()); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
259 rename.addClickHandler(new ClickHandler() { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
260 public void onClick(MenuItemClickEvent evt) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
261 int row = grid.getRecordIndex(record); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
262 grid.startEditing(row, 1, false); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
263 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
264 }); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
265 |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
266 menu.addItem(open); |
778
e14dc5fed6bb
Reordered delete and rename in project context menu, add separator.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
613
diff
changeset
|
267 menu.addItem(rename); |
e14dc5fed6bb
Reordered delete and rename in project context menu, add separator.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
613
diff
changeset
|
268 menu.addItem(new MenuItemSeparator()); |
220
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
269 menu.addItem(del); |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
270 |
35094660f91a
Implemented a context menu for the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
211
diff
changeset
|
271 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
|
272 } |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
273 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
274 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
275 /** |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
276 * 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
|
277 */ |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
278 protected void init() { |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
279 setWidth(MIN_WIDTH); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
280 setMinWidth(MIN_WIDTH); |
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
|
281 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
|
282 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
|
283 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
|
284 setLayoutMargin(0); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
285 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
|
286 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
287 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
|
288 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
|
289 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
|
290 title.setWidth100(); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
291 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
|
292 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
293 Canvas titleWrapper = new Canvas(); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
294 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
|
295 titleWrapper.setWidth100(); |
79
17815a7354bc
Customized background and ProjectList styles.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
25
diff
changeset
|
296 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
|
297 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
|
298 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
299 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
|
300 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
|
301 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
|
302 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
|
303 |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
304 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
|
305 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
|
306 } |
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
|
307 |
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
|
308 |
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
|
309 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
|
310 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
|
311 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
|
312 } |
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
|
313 } |
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
|
314 |
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
|
315 |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
316 public void onEditComplete(EditCompleteEvent event) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
317 if (event.getColNum() != 1) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
318 return; |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
319 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
320 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
321 int row = event.getRowNum(); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
322 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
323 CollectionRecord r = (CollectionRecord) grid.getRecord(row); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
324 Collection c = r.getCollection(); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
325 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
326 Map newValues = event.getNewValues(); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
327 String name = (String) newValues.get("name"); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
328 |
613
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
329 int maxLength = getMaxNameLength(); |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
330 int length = name != null ? name.length() : 0; |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
331 |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
332 if (length <= 0 || length > maxLength) { |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
333 String msg = messages.project_name_too_long(); |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
334 msg = msg.replace("$LEN", String.valueOf(maxLength)); |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
335 SC.warn(msg); |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
336 |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
337 ListGridRecord[] rs = grid.getRecords(); |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
338 rs[row] = (ListGridRecord) event.getOldRecord(); |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
339 grid.setRecords(rs); |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
340 |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
341 return; |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
342 } |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
343 |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
344 c.setName(name); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
345 updateCollectionName(c); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
346 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
347 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
348 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
349 /** |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
350 * Set the name of the collection <i>c</i> to a new value. If the update |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
351 * process succeeded, the project list is refreshed. |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
352 * |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
353 * @param c The Collection with a new name. |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
354 */ |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
355 protected void updateCollectionName(Collection c) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
356 if (c == null) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
357 return; |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
358 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
359 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
360 GWT.log("Update Collection name: " + c.identifier()); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
361 GWT.log("=> New name = " + c.getName()); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
362 |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
363 Config config = Config.getInstance(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
364 nameService.setName(c, config.getServerUrl(), new AsyncCallback<Void>(){ |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
365 public void onFailure(Throwable caught) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
366 String msg = caught.getMessage(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
367 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
368 try { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
369 SC.warn(messages.getString(msg)); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
370 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
371 catch (MissingResourceException mre) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
372 SC.warn(msg); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
373 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
374 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
375 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
376 public void onSuccess(Void v) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
377 updateUserCollections(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
378 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
379 }); |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
380 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
381 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
382 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
383 /** |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
384 * Set the ttl of the collection <i>c</i> to a new value. If the update |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
385 * process succeeded, the project list is refreshed. |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
386 * |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
387 * @param c The Collection with a new ttl. |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
388 */ |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
389 protected void updateCollectionTTL(Collection c) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
390 if (c == null) { |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
391 return; |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
392 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
393 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
394 GWT.log("Update Collection TTL: " + c.identifier()); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
395 GWT.log("=> New ttl = " + c.getTTL()); |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
396 |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
397 Config config = Config.getInstance(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
398 ttlService.setTTL(c, config.getServerUrl(), new AsyncCallback<Void>() { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
399 public void onFailure(Throwable caught) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
400 String msg = caught.getMessage(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
401 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
402 try { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
403 SC.warn(messages.getString(msg)); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
404 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
405 catch (MissingResourceException mre) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
406 SC.warn(msg); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
407 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
408 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
409 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
410 public void onSuccess(Void v) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
411 updateUserCollections(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
412 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
413 }); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
414 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
415 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
416 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
417 /** |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
418 * Delete the collection <i>c</i>. |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
419 * |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
420 * @param c The Collection that should be deleted. |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
421 */ |
600
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
599
diff
changeset
|
422 protected void deleteCollection(final Collection c) { |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
423 if (c == null) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
424 return; |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
425 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
426 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
427 GWT.log("Delete Collection: " + c.identifier()); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
428 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
429 Config config = Config.getInstance(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
430 deleteService.delete(c, config.getServerUrl(), new AsyncCallback<Void>(){ |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
431 public void onFailure(Throwable caught) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
432 String msg = caught.getMessage(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
433 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
434 try { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
435 SC.warn(messages.getString(msg)); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
436 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
437 catch (MissingResourceException mre) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
438 SC.warn(msg); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
439 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
440 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
441 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
442 public void onSuccess(Void v) { |
600
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
599
diff
changeset
|
443 flys.getWorkspace().destroyProject(c.identifier()); |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
444 updateUserCollections(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
445 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
446 }); |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
447 } |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
448 |
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
449 |
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
|
450 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
|
451 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
|
452 |
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
|
453 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
|
454 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
|
455 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
|
456 |
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
|
457 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
|
458 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
|
459 public void onFailure(Throwable caught) { |
598
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
460 String msg = caught.getMessage(); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
461 |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
462 try { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
463 SC.warn(messages.getString(msg)); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
464 } |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
465 catch (MissingResourceException mre) { |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
466 SC.warn(msg); |
031357c3e23e
Added stubs to set the name and ttl of a collection and to delete a collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
597
diff
changeset
|
467 } |
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
|
468 } |
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
|
469 |
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
|
470 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
|
471 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
|
472 |
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
|
473 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
|
474 |
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
|
475 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
|
476 } |
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
|
477 } |
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
|
478 ); |
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
|
479 } |
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
|
480 |
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
|
481 |
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
|
482 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
|
483 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
|
484 |
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
|
485 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
|
486 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
|
487 } |
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
|
488 } |
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
|
489 |
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
|
490 |
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
|
491 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
|
492 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
|
493 |
599
1dbffe4c6d12
Implemented the RPC stubs to set the TTL and name of a collection and to delete an existing collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
598
diff
changeset
|
494 if (collections == null || collections.length == 0) { |
1dbffe4c6d12
Implemented the RPC stubs to set the TTL and name of a collection and to delete an existing collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
598
diff
changeset
|
495 return; |
1dbffe4c6d12
Implemented the RPC stubs to set the TTL and name of a collection and to delete an existing collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
598
diff
changeset
|
496 } |
1dbffe4c6d12
Implemented the RPC stubs to set the TTL and name of a collection and to delete an existing collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
598
diff
changeset
|
497 |
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
|
498 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
|
499 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
|
500 } |
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
|
501 } |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
502 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
503 |
613
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
504 public int getMaxNameLength() { |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
505 return MAX_NAME_LENGTH; |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
506 } |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
507 |
471ca61b83b5
#165 Set the max length of project names to 50 characters.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
608
diff
changeset
|
508 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
509 /** |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
510 * 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
|
511 * project. |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
512 * |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
513 * @return the grid field. |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
514 */ |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
515 protected ListGridField buildDateField() { |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
516 ListGridField date = new ListGridField( |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
517 "creationTime", messages.projectlist_creationTime()); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
518 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
519 date.setType(ListGridFieldType.DATE); |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
520 date.setCanEdit(false); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
521 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
522 date.setCellFormatter(new CellFormatter() { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
523 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
|
524 if (value == null) { |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
525 return null; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
526 } |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
527 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
528 DateTimeFormat dtf = DateTimeFormat.getFormat( |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
529 messages.datetime_format()); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
530 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
531 return dtf.format((Date)value); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
532 } |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
533 }); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
534 |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
535 date.setWidth(COLUMN_DATE_WIDTH); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
536 date.setAlign(Alignment.CENTER); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
537 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
538 return date; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
539 } |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
540 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
541 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
542 /** |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
543 * 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
|
544 * |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
545 * @return the grid field. |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
546 */ |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
547 protected ListGridField buildNameField() { |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
548 ListGridField name = new ListGridField( |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
549 "name", messages.projectlist_title()); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
550 |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
551 name.setType(ListGridFieldType.TEXT); |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
552 name.setShowHover(true); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
553 name.setHoverCustomizer(new HoverCustomizer() { |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
554 public String hoverHTML( |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
555 Object value, |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
556 ListGridRecord record, |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
557 int row, |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
558 int col) |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
559 { |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
560 CollectionRecord r = (CollectionRecord) record; |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
561 Collection c = r.getCollection(); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
562 |
607
3acc631efdf0
Escape project's names in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
606
diff
changeset
|
563 String name = r.getName(); |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
564 |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
565 return name != null && name.length() > 0 |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
566 ? name |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
567 : c.identifier(); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
568 } |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
569 }); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
570 |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
571 name.setWidth(COLUMN_TITLE_WIDTH); |
226
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
572 name.setAlign(Alignment.LEFT); |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
573 |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
574 return name; |
a13382876e5d
The project list is sorted now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
575 } |
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
|
576 |
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
|
577 |
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
|
578 protected ListGridField buildFavoriteField() { |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
579 ListGridField fav = new ListGridField( |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
580 "ttl", messages.projectlist_favorite()); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
581 |
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
|
582 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
|
583 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
|
584 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
|
585 fav.setImageURLSuffix(".png"); |
606
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
586 fav.setWidth(COLUMN_FAVORITE_WIDTH); |
69c0a6ecad57
#165 (part 1) Added tooltips and table headers in the project list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
587 fav.setAlign(Alignment.CENTER); |
597
14e5e51a7de4
Improved the project list - listeners are notified after setting the name and ttl of a project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
587
diff
changeset
|
588 fav.setCanEdit(false); |
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
|
589 |
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
|
590 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
|
591 } |
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
|
592 } |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
593 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |