annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 260:dd1dad2ff94e

Remove the data table on step back. flys-client/trunk@1875 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Raimund Renkert <raimund.renkert@intevation.de>
date Tue, 10 May 2011 10:57:57 +0000
parents 50a95db68e66
children d01b0d81b92a
rev   line source
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui;
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
3 import java.util.ArrayList;
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
4 import java.util.HashMap;
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
5 import java.util.List;
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
6 import java.util.Map;
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
7 import java.util.Set;
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
8
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9 import com.google.gwt.core.client.GWT;
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
10 import com.google.gwt.user.client.rpc.AsyncCallback;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
12 import com.smartgwt.client.util.SC;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import com.smartgwt.client.widgets.Window;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
14 import com.smartgwt.client.widgets.layout.Layout;
7
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
15 import com.smartgwt.client.widgets.layout.VLayout;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
16 import com.smartgwt.client.widgets.tab.TabSet;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
18 import de.intevation.flys.client.shared.model.Artifact;
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
19 import de.intevation.flys.client.shared.model.ArtifactDescription;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
20 import de.intevation.flys.client.shared.model.Collection;
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
21 import de.intevation.flys.client.shared.model.OutputMode;
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
22 import de.intevation.flys.client.shared.model.User;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23
14
fe2f4d1dd784 Integrated the httpclient for the communication between client and server. It is now possible to create a new WINFO artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 13
diff changeset
24 import de.intevation.flys.client.client.Config;
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
25 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: 102
diff changeset
26 import de.intevation.flys.client.client.FLYSConstants;
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
27 import de.intevation.flys.client.client.event.HasCollectionChangeHandlers;
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
28 import de.intevation.flys.client.client.event.CollectionChangeEvent;
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
29 import de.intevation.flys.client.client.event.CollectionChangeHandler;
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
30 import de.intevation.flys.client.client.event.ParameterChangeEvent;
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
31 import de.intevation.flys.client.client.event.ParameterChangeHandler;
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
32 import de.intevation.flys.client.client.services.AddArtifactService;
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
33 import de.intevation.flys.client.client.services.AddArtifactServiceAsync;
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
34 import de.intevation.flys.client.client.services.CreateCollectionService;
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
35 import de.intevation.flys.client.client.services.CreateCollectionServiceAsync;
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
36 import de.intevation.flys.client.client.services.DescribeCollectionService;
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
37 import de.intevation.flys.client.client.services.DescribeCollectionServiceAsync;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 */
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
43 public class CollectionView
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
44 extends Window
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
45 implements CollectionChangeHandler, HasCollectionChangeHandlers,
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
46 ParameterChangeHandler
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
47 {
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
48 /** The ArtifactService used to communicate with the Artifact server. */
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
49 protected CreateCollectionServiceAsync createCollectionService =
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
50 GWT.create(CreateCollectionService.class);
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
51
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
52 /** The AddArtifactService used to add an artifact to a collection. */
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
53 protected AddArtifactServiceAsync addArtifactService =
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
54 GWT.create(AddArtifactService.class);
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
55
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
56 /** The DescribeCollectionService used to update the existing collection. */
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
57 protected DescribeCollectionServiceAsync describeCollectionService =
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
58 GWT.create(DescribeCollectionService.class);
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
59
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 /** The message class that provides i18n strings.*/
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: 102
diff changeset
61 protected FLYSConstants messages = GWT.create(FLYSConstants.class);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
63 /** The FLYS instance used to call services.*/
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
64 protected FLYS flys;
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
65
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
66 /** The ParameterList.*/
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
67 protected ParameterList parameterList;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
68
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
69 /** The list of ValueChangeHandlers.*/
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
70 protected List<CollectionChangeHandler> handlers;
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
71
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 /** The collection to be displayed.*/
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 protected Collection collection;
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74
30
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
75 /** The artifact that handles the parameterization.*/
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
76 protected Artifact artifact;
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
77
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
78 protected TabSet tabs;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
79
7
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
80 /** The output tab.*/
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
81 protected Map<String, OutputTab> outputTabs;
7
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
82
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
83 /** The layout.*/
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
84 protected Layout layout;
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
85
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88 * This constructor creates a new CollectionView that is used to display the
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89 * <i>collection</i>.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 *
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 * @param collection The collection to be displayed.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 */
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
93 public CollectionView(FLYS flys) {
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
94 this.flys = flys;
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
95 this.tabs = new TabSet();
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
96 this.outputTabs = new HashMap<String, OutputTab>();
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
97 this.handlers = new ArrayList<CollectionChangeHandler>();
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
98 this.layout = new VLayout();
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
99 this.parameterList = new ParameterList(
92
fa3d9f79dff5 Changed some german strings.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 91
diff changeset
100 flys, this, messages.new_project());
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
101
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
102 addCollectionChangeHandler(this);
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
103
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
104 parameterList.addParameterChangeHandler(this);
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
105
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 init();
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 }
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
110 public CollectionView(FLYS flys, Collection collection, Artifact artifact) {
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
111 this.flys = flys;
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
112 this.tabs = new TabSet();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
113 this.outputTabs = new HashMap<String, OutputTab>();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
114 this.handlers = new ArrayList<CollectionChangeHandler>();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
115 this.layout = new VLayout();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
116 this.parameterList = new ParameterList(
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
117 flys,
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
118 this,
228
bbe32496dc84 The title of a the ParameterList tab depends on the Artifact's name if we create a new project window with an existing Artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 224
diff changeset
119 messages.getString(artifact.getName()),
224
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
120 artifact);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
121
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
122 addCollectionChangeHandler(this);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
123
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
124 parameterList.addParameterChangeHandler(this);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
125
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
126 init();
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
127
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
128 setCollection(collection);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
129 setArtifact(artifact);
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
130 }
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
131
a4a68b4ee2a3 Improved the CollectionView and the ParameterList - both can be initialized with an existing artifact (parameterization).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 215
diff changeset
132
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
133 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
134 * This method handles the initial layout stuff.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
135 */
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
136 protected void init() {
91
0d8203594bb4 Resized CollectionView and set the content size to have a tabled style.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 90
diff changeset
137 setWidth(750);
39
4187a797fc3d Implemented the step forward mechanism in the CollectionView and added the river map to the initial widget.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 37
diff changeset
138 setHeight(600);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
139
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
140 layout.setWidth100();
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
141
77
5b5ec0403844 Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 75
diff changeset
142 setCanDragReposition(true);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
143 setCanDragResize(true);
77
5b5ec0403844 Limited the area for CollectionView to the size of FLYSWorkspace.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 75
diff changeset
144 setKeepInParentRect(true);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
145
84
b8acb6a615f2 Removed the title (date string) of CollectionViews.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
146 setTitle("");
7
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
147
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
148 addItem(layout);
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
149
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
150 layout.addMember(tabs);
90
f8c240f28c2a The title of the parameter tab will change after the module has been selectd.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 87
diff changeset
151 tabs.addTab(parameterList);
7
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
152 }
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
153
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
154
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
155 /**
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
156 * This method triggers the CreateCollectionService to create a new
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
157 * collection in the artifact server.
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
158 *
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
159 * @param ownerId The uuid of the user that should own the new collection.
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
160 */
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
161 protected void createNewCollection(String ownerId) {
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
162 GWT.log("CollectionView.createNewCollection");
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
163
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: 228
diff changeset
164 Config config = Config.getInstance();
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: 228
diff changeset
165 final String url = config.getServerUrl();
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: 228
diff changeset
166 final String locale = config.getLocale();
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
167
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
168 createCollectionService.create(
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: 228
diff changeset
169 url, locale, ownerId,
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
170 new AsyncCallback<Collection>() {
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
171 public void onFailure(Throwable caught) {
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
172 GWT.log("Could not create the new collection.");
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
173 SC.warn(messages.getString(caught.getMessage()));
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
174 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
175
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
176 public void onSuccess(Collection collection) {
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
177 GWT.log("Successfully created a new collection.");
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
178
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
179 Artifact artifact = getArtifact();
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: 228
diff changeset
180 addArtifactService.add(collection, artifact, url, locale,
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
181 new AsyncCallback<Collection>() {
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
182
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
183 public void onFailure(Throwable caught) {
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
184 GWT.log("An error occured while adding artifact.");
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
185 SC.warn(messages.getString(caught.getMessage()));
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
186 }
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
187
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
188 public void onSuccess(Collection newCollection) {
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
189 GWT.log("Successfully added artifact.");
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
190 setCollection(newCollection);
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
191 }
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
192 }
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
193 );
26
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
194 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
195 });
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
196 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
197
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
198
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
199 protected FLYS getFlys() {
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
200 return flys;
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
201 }
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
202
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
203
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
204
c19985f75118 Implemented a service that triggers the artifact-collection creation in the artifact server.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 23
diff changeset
205 /**
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
206 * This method registers a new ValueChangeHandler.
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
207 *
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
208 * @param handler The new ValueChangeHandler.
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
209 */
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
210 public void addCollectionChangeHandler(CollectionChangeHandler handler) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
211 if (handler != null) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
212 handlers.add(handler);
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
213 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
214 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
215
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
216
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
217
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
218 /**
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
219 * This method calls the <code>onValueChange()</code> method of all
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
220 * registered ValueChangeHanders.
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
221 */
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
222 protected void fireCollectionChangeEvent(
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
223 Collection old, Collection newCol)
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
224 {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
225 for (CollectionChangeHandler handler: handlers) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
226 handler.onCollectionChange(new CollectionChangeEvent(old, newCol));
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
227 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
228 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
229
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
230
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
231 /**
7
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
232 * This method returns true, if the Collection is new and no plugins has
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
233 * been chosen.
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
234 *
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
235 * @return true, if the Collection is new.
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
236 */
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
237 public boolean isNew() {
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
238 return collection.getItemLength() == 0 ? true : false;
7
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
239 }
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
240
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
241
a65793e08245 Radio buttons for each plugin are displayed if a new CollectionView is created.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
242 /**
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
243 * Returns the artifact that is used for the parameterization.
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
244 *
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
245 * @return the artifact that is used for the parameterization.
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
246 */
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
247 protected Artifact getArtifact() {
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
248 return artifact;
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
249 }
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
250
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
251
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
252 /**
30
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
253 * Set the current artifact that is the master of the parameterization.
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
254 *
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
255 * @param artifact The new artifact.
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
256 */
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
257 protected void setArtifact(Artifact artifact) {
5709bd8f4d7c Added a new widget that combines the module and the river selection. Users can now choose the desired plugin and river in one step.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 26
diff changeset
258 this.artifact = artifact;
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
259 }
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
260
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
261
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
262 /**
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
263 * Implements the onCollectionChange() method to do update the GUI after the
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
264 * parameterization has changed.
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
265 *
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
266 * @param event The ParameterChangeEvent.
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
267 */
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
268 public void onParameterChange(ParameterChangeEvent event) {
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
269 GWT.log("CollectionView.onParameterChange");
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
270
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
271 Artifact art = event.getNewValue();
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
272 ArtifactDescription desc = art.getArtifactDescription();
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
273 OutputMode[] outs = desc.getOutputModes();
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
274
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
275 setArtifact(art);
87
c8cd1b918901 Bugfix: Step back will remove duplicated output tab and an extended chart image URL bypasses the browser cache.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 84
diff changeset
276 clearOutputTabs();
73
39210a74db07 Moved parameterization specific code from CollectionView to ParameterList.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 72
diff changeset
277
260
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 259
diff changeset
278 if (parameterList.hasPanel()) {
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 259
diff changeset
279 parameterList.removePanel();
dd1dad2ff94e Remove the data table on step back.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 259
diff changeset
280 }
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: 228
diff changeset
281 Collection c = getCollection();
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
282
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: 228
diff changeset
283 if (outs != null && c == null) {
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
284 User user = getFlys().getCurrentUser();
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
285 createNewCollection(user.identifier());
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
286 }
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: 228
diff changeset
287 else if (outs != null && c != null) {
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
288 Config config = Config.getInstance();
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
289 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: 228
diff changeset
290 String locale = config.getLocale();
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
291
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: 228
diff changeset
292 describeCollectionService.describe(c.identifier(), url, locale,
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
293 new AsyncCallback<Collection>() {
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
294 public void onFailure(Throwable caught) {
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
295 GWT.log("Could not DESCRIBE collection.");
215
e02f50a3ad59 Improved the exception handling of artifact / collection specific operations. Warning dialog are displayed after such an exception.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 211
diff changeset
296 SC.warn(messages.getString(caught.getMessage()));
100
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
297 }
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
298
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
299
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
300 public void onSuccess(Collection newCollection) {
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
301 GWT.log("Successfully DESCRIBED collection.");
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
302 setCollection(newCollection);
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
303 }
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
304 }
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
305 );
95b30a5d6350 Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 92
diff changeset
306 }
71
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
307 else {
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
308 updateView();
987567f31200 Adjusted the return type of the CreateCollectionService and added code to react on Collection changes (like output modes).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 60
diff changeset
309 }
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
310 }
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
311
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
312
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
313 /**
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
314 * Returns the collection of displayed by this view.
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
315 *
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
316 * @return the collection of this view.
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
317 */
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
318 protected Collection getCollection() {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
319 return collection;
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
320 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
321
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
322
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
323 /**
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
324 * Set the current collection.
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
325 *
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
326 * @param collection The new collection.
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
327 */
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
328 protected void setCollection(Collection collection) {
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
329 Collection tmp = this.collection;
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
330 this.collection = collection;
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
331
19
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
332 fireCollectionChangeEvent(tmp, this.collection);
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
333 }
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
334
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
335
f48b2cb2e219 The CollectionView implements the HasCollectionChangeHandlers interface now.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
336 public void onCollectionChange(CollectionChangeEvent event) {
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
337 Collection newCol = event.getNewValue();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
338
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
339 Map<String, OutputMode> outs = newCol.getOutputModes();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
340
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
341 Set<String> keys = outs.keySet();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
342 for (String outname: keys) {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
343 addOutputTab(outname, outs.get(outname));
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
344 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
345
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
346 updateView();
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
347 }
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
348
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
349
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
350 /**
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
351 * Adds a new tab for the OutputMode <i>out</i>.
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
352 *
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
353 * @param name The name and title of the output.
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
354 */
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
355 protected void addOutputTab(String name, OutputMode out) {
239
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
356 // XXX Maybe we should change this determination of visual outputs. I am
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
357 // not sure if the mimetype is the correct value for this!
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 239
diff changeset
358
239
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
359 if (out.getMimeType().equals("text/plain")) {
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 239
diff changeset
360 TableDataPanel p = new TableDataPanel();
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 239
diff changeset
361 p.setUuid(collection.identifier());
259
50a95db68e66 Build a dynamic table for the CSV data.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 256
diff changeset
362 p.setName(out.getName());
256
5e1c1b7d6516 Added table and service for calculation output to UI.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 239
diff changeset
363 parameterList.setPanel (p);
239
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
364 return;
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
365 }
47fe77a1bac7 Added new i18n strings for new output modes.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
366
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
367 GWT.log("Add new output tab for '" + name + "'");
75
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 74
diff changeset
368
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 74
diff changeset
369 // TODO Source this out to a factory that creates the different
571843833129 Added a panel that will be used to display chart output.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 74
diff changeset
370 // OutputTabs.
102
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
371 String title = messages.getString(name);
33e24b33fc38 Improved the way how to i18n strings in our application.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
372 OutputTab tab = new ChartOutputTab(title, getCollection(), out);
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
373 outputTabs.put(name, tab);
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
374 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
375
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
376
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
377 /**
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
378 * Removes all output mode tabs from tab bar.
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
379 */
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
380 protected void clearOutputTabs() {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
381 GWT.log("Clear OutputTabs.");
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
382
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
383 int num = tabs.getNumTabs();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
384
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
385 for (int i = num-1; i >= 1; i--) {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
386 tabs.removeTab(i);
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
387 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
388
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
389 outputTabs.clear();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
390 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
391
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
392
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
393 /**
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
394 * Update the view (refresh the list of old and current data).
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
395 */
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
396 protected void updateView() {
36
3cacc9d2dd01 CollectionView implements HasParameterChangeHandler and ParameterChangeHandler interfaces.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 32
diff changeset
397 GWT.log("CollectionView.updateView()");
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
398 updateOutputTabs();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
399 }
23
dc086030e6a3 The CollectionView is able to create new instances of a WINFO artifact and to display the artifact's state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 19
diff changeset
400
74
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
401
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
402 /**
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
403 * This method is used to update the tabs to show specific output modes.
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
404 */
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
405 protected void updateOutputTabs() {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
406 GWT.log("Update output tabs.");
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
407 if (outputTabs != null) {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
408 Set<String> keys = outputTabs.keySet();
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
409
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
410 for (String key: keys) {
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
411 tabs.addTab(outputTabs.get(key));
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
412 }
c5586446f3c0 Available output modes are displayed in the tab bar of the collection view.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 73
diff changeset
413 }
13
8d9075c07667 Enhanced the CollectionView: there are radio buttons for each module and a button to select one of those.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 7
diff changeset
414 }
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
415 }
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
416 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org