annotate gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultModule.java @ 8870:c26fb37899ca

Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui. Also using now the localization info from the server instead of localizing the modules again on the client side.
author gernotbelger
date Wed, 07 Feb 2018 11:59:13 +0100
parents 5811dfe22897
children
rev   line source
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
2 * Software engineering by Intevation GmbH
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
3 *
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
4 * This file is Free Software under the GNU AGPL (>=v3)
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the
5993
ea9eef426962 Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5861
diff changeset
6 * documentation coming with Dive4Elements River for details.
5861
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
7 */
172338b1407f GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5838
diff changeset
8
5835
821a02bbfb4e Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5834
diff changeset
9 package org.dive4elements.river.client.shared.model;
3514
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
10
7760
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
11 import java.util.List;
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
12
3514
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
13 public class DefaultModule implements Module {
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
14
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
15 private String name;
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
16 private String localname;
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
17 private ModuleGroup group;
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
18 private boolean selected;
7760
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
19 private List<String> rivers;
3514
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
20
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
21 public DefaultModule() {
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
22 }
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
23
7760
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
24 public DefaultModule(
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
25 final String name,
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
26 final String localname,
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
27 final boolean selected,
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
28 final String groupId,
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
29 final String groupLabel,
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
30 final List<String> rivers) {
3514
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
31 this.name = name;
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
32 this.localname = localname;
3528
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
33 this.selected = selected;
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
34 this.group = new ModuleGroup(groupId, groupLabel);
7760
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
35 this.rivers = rivers;
3514
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
36 }
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
37
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
38 /**
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
39 * Returns the name of the module
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
40 */
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
41 @Override
3514
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
42 public String getName() {
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
43 return this.name;
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
44 }
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
45
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
46 /**
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
47 * Returns the localized name of the module
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
48 */
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
49 @Override
3514
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
50 public String getLocalizedName() {
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
51 return this.localname;
1f293ada93d0 Added class representation of a module artifact
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
diff changeset
52 }
3528
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
53
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
54 /**
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
55 * Returns true if the module should be selected
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
56 */
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
57 @Override
3528
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
58 public boolean isSelected() {
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
59 return this.selected;
b5825159250e Add isSelected method to Module classes
Bjoern Ricks <bjoern.ricks@intevation.de>
parents: 3514
diff changeset
60 }
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
61
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
62 @Override
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
63 public ModuleGroup getGroup() {
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
64 return this.group;
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
65 }
7760
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
66
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
67 /**
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
68 * @return the rivers
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
69 */
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
70 @Override
7760
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
71 public List<String> getRivers() {
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
72 return this.rivers;
5811dfe22897 Added list to module to store supported rivers.
Raimund Renkert <rrenkert@intevation.de>
parents: 5993
diff changeset
73 }
8870
c26fb37899ca Introduced groups for modules. Modules marked with the same group-id, will be put together in the ui.
gernotbelger
parents: 7760
diff changeset
74 }

http://dive4elements.wald.intevation.org