1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package info.magnolia.ui.form.field.definition;
35
36 import info.magnolia.annotation.deprecation.MgnlDeprecated;
37
38 import info.magnolia.ui.form.field.transformer.composite.CompositeTransformer;
39
40 import java.util.ArrayList;
41 import java.util.Collections;
42 import java.util.List;
43
44 import org.slf4j.Logger;
45 import org.slf4j.LoggerFactory;
46
47 import com.google.common.base.Function;
48 import com.google.common.collect.Lists;
49
50
51
52
53
54
55
56
57
58 @Deprecated
59 @MgnlDeprecated(since = "6.2", description = "Use new framework and info.magnolia.ui.field.CompositeFieldDefinition instead.")
60 public class CompositeFieldDefinition extends ConfiguredFieldDefinition {
61
62 private static final Logger log = LoggerFactory.getLogger(CompositeFieldDefinition.class);
63
64 private List<ConfiguredFieldDefinition> fields = new ArrayList<ConfiguredFieldDefinition>();
65 private Layout layout = Layout.horizontal;
66 private String nodeType;
67
68
69
70
71 public CompositeFieldDefinition() {
72 setTransformerClass(CompositeTransformer.class);
73 }
74
75 public List<ConfiguredFieldDefinition> getFields() {
76 return fields;
77 }
78
79 public void setFields(List<ConfiguredFieldDefinition> fields) {
80 this.fields = fields;
81 }
82
83 public void addField(ConfiguredFieldDefinition field) {
84 this.fields.add(field);
85 }
86
87
88
89
90 public List<String> getFieldNames() {
91
92 return Collections.unmodifiableList(Lists.transform(fields, new Function<ConfiguredFieldDefinition, String>() {
93 @Override
94 public String apply(ConfiguredFieldDefinition fieldDefinition) {
95 return fieldDefinition.getName();
96 }
97 }));
98 }
99
100
101
102
103 @Deprecated
104 public List<String> getFieldsName() {
105 return getFieldNames();
106 }
107
108
109
110
111 @Deprecated
112 public void addFieldName(String fieldName) {
113 log.warn("CompositeFieldDefinition#addFieldName is deprecated and has no effect. Please adjust your code accordingly.");
114 }
115
116
117
118
119 public Layout getLayout() {
120 return layout;
121 }
122
123 public void setLayout(Layout layout) {
124 this.layout = layout;
125 }
126
127
128
129
130 public String getNodeType() {
131 return nodeType;
132 }
133
134 public void setNodeType(String nodeType) {
135 this.nodeType = nodeType;
136 }
137 }