comparison gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ModuleGroup.java @ 8871:78cd6572778d

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 12:02:58 +0100
parents
children
comparison
equal deleted inserted replaced
8870:c26fb37899ca 8871:78cd6572778d
1 /** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde
2 * Software engineering by
3 * Björnsen Beratende Ingenieure GmbH
4 * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt
5 *
6 * This file is Free Software under the GNU AGPL (>=v3)
7 * and comes with ABSOLUTELY NO WARRANTY! Check out the
8 * documentation coming with Dive4Elements River for details.
9 */
10 package org.dive4elements.river.client.shared.model;
11
12 import java.io.Serializable;
13
14 /**
15 * A module group marks modules to belong to a common group. Modules of the same group are put together in the user-interface.
16 *
17 * @author Gernot Belger
18 */
19 public class ModuleGroup implements Serializable {
20
21 private static final long serialVersionUID = 1L;
22
23 private String id;
24 private String label;
25
26 public ModuleGroup() {
27 this.id = null;
28 this.label = null;
29 }
30
31 public ModuleGroup(final String id, final String label) {
32 this.id = id;
33 this.label = label;
34 }
35
36 @Override
37 public String toString() {
38 return label;
39 }
40
41 @Override
42 public int hashCode() {
43 return id == null ? 0 : id.hashCode();
44 }
45
46 @Override
47 public boolean equals(Object obj) {
48
49 if (obj == null)
50 return false;
51 if (obj == this)
52 return true;
53
54 if (obj.getClass() != getClass()) {
55 return false;
56 }
57
58 final ModuleGroup rhs = (ModuleGroup) obj;
59 return (id == rhs.id) || (id != null && id.equals(rhs.id));
60 }
61
62 public boolean showGroupFrame() {
63 return label != null && !label.trim().isEmpty();
64 }
65 }

http://dive4elements.wald.intevation.org