01: package simpleorm.simplewebapp.core;
02:
03: import simpleorm.simplewebapp.core.WField;
04:
05: import java.util.LinkedHashMap;
06: import java.util.Collection;
07:
08: /**
09: * A set of fields on a form, eg. the crud scalarFields and the list scalarFields.
10: */
11: public class WFieldGroup extends WFieldNode { // Directly extending LinkedHashMap confuses JSP/EL (!)
12: LinkedHashMap<String, WField> fields = new LinkedHashMap(); // indexed on fullName
13:
14: public WFieldGroup(String name) {
15: this .shortName = name;
16: }
17:
18: public void add(WField field) {
19: fields.put(field.shortName, field);
20: //System.println.println("Added " + field + options().size());
21: }
22:
23: public WField getField(String name) {
24: return fields.get(name);
25: }
26:
27: public Collection<WField> getValues() {
28: return fields.values();
29: }
30:
31: public String toString() {//webBean.logger.debug("toStringing " + name);
32: return "{WFieldGroup " + pagelet.name + "." + shortName + "}";
33: }
34:
35: //////////////////// generated ///////////////////////
36:
37: public LinkedHashMap<String, WField> getFields() {
38: return fields;
39: }
40: }
|