comparison 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
comparison
equal deleted inserted replaced
8869:20b85ea3b524 8870:c26fb37899ca
12 12
13 public class DefaultModule implements Module { 13 public class DefaultModule implements Module {
14 14
15 private String name; 15 private String name;
16 private String localname; 16 private String localname;
17 private boolean selected = false; 17 private ModuleGroup group;
18 private boolean selected;
18 private List<String> rivers; 19 private List<String> rivers;
19 20
20 public DefaultModule() { 21 public DefaultModule() {
21 } 22 }
22 23
23 public DefaultModule( 24 public DefaultModule(
24 String name, 25 final String name,
25 String localname, 26 final String localname,
26 boolean selected, 27 final boolean selected,
27 List<String> rivers) { 28 final String groupId,
29 final String groupLabel,
30 final List<String> rivers) {
28 this.name = name; 31 this.name = name;
29 this.localname = localname; 32 this.localname = localname;
30 this.selected = selected; 33 this.selected = selected;
34 this.group = new ModuleGroup(groupId, groupLabel);
31 this.rivers = rivers; 35 this.rivers = rivers;
32 } 36 }
33 37
34 /** 38 /**
35 * Returns the name of the module 39 * Returns the name of the module
36 */ 40 */
41 @Override
37 public String getName() { 42 public String getName() {
38 return this.name; 43 return this.name;
39 } 44 }
40 45
41 /** 46 /**
42 * Returns the localized name of the module 47 * Returns the localized name of the module
43 */ 48 */
49 @Override
44 public String getLocalizedName() { 50 public String getLocalizedName() {
45 return this.localname; 51 return this.localname;
46 } 52 }
47 53
48 /** 54 /**
49 * Returns true if the module should be selected 55 * Returns true if the module should be selected
50 */ 56 */
57 @Override
51 public boolean isSelected() { 58 public boolean isSelected() {
52 return this.selected; 59 return this.selected;
60 }
61
62 @Override
63 public ModuleGroup getGroup() {
64 return this.group;
53 } 65 }
54 66
55 /** 67 /**
56 * @return the rivers 68 * @return the rivers
57 */ 69 */
70 @Override
58 public List<String> getRivers() { 71 public List<String> getRivers() {
59 return this.rivers; 72 return this.rivers;
60 } 73 }
61 } 74 }
62 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 tw=80 :

http://dive4elements.wald.intevation.org