comparison flys-client/src/main/java/de/intevation/flys/client/shared/model/PropertyGroup.java @ 3859:62332fa199bf

Work on "Date" support for ManualPointsEditor. flys-client/trunk@5621 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Christian Lins <christian.lins@intevation.de>
date Thu, 27 Sep 2012 14:09:24 +0000
parents 3304608baf35
children
comparison
equal deleted inserted replaced
3858:87e7571970e6 3859:62332fa199bf
1 package de.intevation.flys.client.shared.model; 1 package de.intevation.flys.client.shared.model;
2 2
3 import java.util.ArrayList;
3 import java.util.List; 4 import java.util.List;
4 import java.util.ArrayList;
5 5
6 /** 6 /**
7 * A group of properties.
7 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> 8 * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a>
8 */ 9 */
9 public class PropertyGroup implements Property, Cloneable { 10 public class PropertyGroup implements Property, Cloneable {
10 11
11 /** The group name */ 12 /** The group name */
12 protected String name; 13 protected String name;
13 14
14 protected List<Property> properties; 15 protected List<Property> properties;
15 16
16 public PropertyGroup() { 17 public PropertyGroup() {
17
18 } 18 }
19 19
20 public PropertyGroup(String name) { 20 public PropertyGroup(String name) {
21 this.name = name; 21 this.name = name;
22 } 22 }
49 } 49 }
50 } 50 }
51 return null; 51 return null;
52 } 52 }
53 53
54 54 @Override
55 public Object clone() { 55 public Object clone() {
56 PropertyGroup clone = new PropertyGroup(this.getName()); 56 PropertyGroup clone = new PropertyGroup(this.getName());
57 List<Property> cloneList = new ArrayList<Property>(); 57 List<Property> cloneList = new ArrayList<Property>();
58 for(Property p: properties) { 58 for(Property p: properties) {
59 cloneList.add((Property)p.clone()); 59 cloneList.add((Property)p.clone());
60 } 60 }
61 clone.setProperties(cloneList); 61 clone.setProperties(cloneList);
62 return clone; 62 return clone;
63 } 63 }
64
65 @Override
66 public String toString() {
67 StringBuilder buf = new StringBuilder();
68
69 for(Property p : properties) {
70 buf.append(p.getName());
71 buf.append("=");
72 if(p instanceof PropertySetting) {
73 buf.append(((PropertySetting)p).getValue().toString());
74 }
75 buf.append(" ");
76 }
77
78 return buf.toString();
79 }
64 } 80 }

http://dive4elements.wald.intevation.org