1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.kew.docsearch; |
17 | |
|
18 | |
import java.util.ArrayList; |
19 | |
import java.util.List; |
20 | |
import java.util.Set; |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
public class StandardDocSearchCriteriaFieldContainer implements java.io.Serializable { |
30 | |
|
31 | |
private static final long serialVersionUID = 7334865718915897486L; |
32 | |
|
33 | |
private String fieldKey; |
34 | |
private String labelMessageKey; |
35 | |
private String labelFieldWidthValue; |
36 | |
private String labelFieldHeightValue; |
37 | |
private String dataFieldWidthValue; |
38 | |
private String dataFieldHeightValue; |
39 | 0 | private List<StandardSearchCriteriaField> fields = new ArrayList<StandardSearchCriteriaField>(); |
40 | |
|
41 | 0 | public StandardDocSearchCriteriaFieldContainer() {} |
42 | |
|
43 | 0 | public StandardDocSearchCriteriaFieldContainer(String labelKey, StandardSearchCriteriaField field) { |
44 | 0 | if (!org.apache.commons.lang.StringUtils.isEmpty(labelKey)) { |
45 | 0 | this.labelMessageKey = labelKey; |
46 | |
} |
47 | 0 | this.fieldKey = field.getKey(); |
48 | 0 | addField(field); |
49 | 0 | } |
50 | |
|
51 | 0 | public StandardDocSearchCriteriaFieldContainer(String fieldKey, String labelKey, List<StandardSearchCriteriaField> fields) { |
52 | 0 | if (!org.apache.commons.lang.StringUtils.isEmpty(labelKey)) { |
53 | 0 | this.labelMessageKey = labelKey; |
54 | |
} |
55 | 0 | if (!org.apache.commons.lang.StringUtils.isEmpty(fieldKey)) { |
56 | 0 | this.fieldKey = fieldKey; |
57 | |
} |
58 | 0 | this.fields = fields; |
59 | 0 | } |
60 | |
|
61 | 0 | public StandardDocSearchCriteriaFieldContainer(StandardDocSearchCriteriaFieldContainer sourceContainer) { |
62 | 0 | this.fieldKey = sourceContainer.getFieldKey(); |
63 | 0 | this.labelMessageKey = sourceContainer.getLabelMessageKey(); |
64 | 0 | this.labelFieldHeightValue = sourceContainer.getLabelFieldHeightValue(); |
65 | 0 | this.labelFieldWidthValue = sourceContainer.getLabelFieldWidthValue(); |
66 | 0 | this.dataFieldHeightValue = sourceContainer.getDataFieldHeightValue(); |
67 | 0 | this.dataFieldWidthValue = sourceContainer.getDataFieldWidthValue(); |
68 | 0 | this.fields = sourceContainer.getFields(); |
69 | 0 | } |
70 | |
|
71 | |
public void addField(StandardSearchCriteriaField field) { |
72 | 0 | fields.add(field); |
73 | 0 | } |
74 | |
|
75 | |
public boolean isHidden() { |
76 | 0 | for (StandardSearchCriteriaField field1 : fields) |
77 | |
{ |
78 | 0 | if (!field1.isHidden()) |
79 | |
{ |
80 | 0 | return false; |
81 | |
} |
82 | |
} |
83 | 0 | return true; |
84 | |
} |
85 | |
|
86 | |
public void hideFieldsIfNecessary(Set<String> hiddenFieldKeys) { |
87 | 0 | for (StandardSearchCriteriaField field1 : fields) |
88 | |
{ |
89 | 0 | if ((hiddenFieldKeys.contains(getFieldKey())) || (hiddenFieldKeys.contains(field1.getKey()))) |
90 | |
{ |
91 | 0 | field1.setHidden(true); |
92 | |
} |
93 | |
} |
94 | 0 | } |
95 | |
|
96 | |
public String getFieldKey() { |
97 | 0 | return this.fieldKey; |
98 | |
} |
99 | |
|
100 | |
public void setFieldKey(String fieldKey) { |
101 | 0 | this.fieldKey = fieldKey; |
102 | 0 | } |
103 | |
|
104 | |
public String getLabelMessageKey() { |
105 | 0 | return this.labelMessageKey; |
106 | |
} |
107 | |
|
108 | |
public void setLabelMessageKey(String labelMessageKey) { |
109 | 0 | this.labelMessageKey = labelMessageKey; |
110 | 0 | } |
111 | |
|
112 | |
public String getLabelFieldWidthValue() { |
113 | 0 | return this.labelFieldWidthValue; |
114 | |
} |
115 | |
|
116 | |
public void setLabelFieldWidthValue(String labelFieldWidthValue) { |
117 | 0 | this.labelFieldWidthValue = labelFieldWidthValue; |
118 | 0 | } |
119 | |
|
120 | |
public String getLabelFieldHeightValue() { |
121 | 0 | return this.labelFieldHeightValue; |
122 | |
} |
123 | |
|
124 | |
public void setLabelFieldHeightValue(String labelFieldHeightValue) { |
125 | 0 | this.labelFieldHeightValue = labelFieldHeightValue; |
126 | 0 | } |
127 | |
|
128 | |
public String getDataFieldWidthValue() { |
129 | 0 | return this.dataFieldWidthValue; |
130 | |
} |
131 | |
|
132 | |
public void setDataFieldWidthValue(String dataFieldWidthValue) { |
133 | 0 | this.dataFieldWidthValue = dataFieldWidthValue; |
134 | 0 | } |
135 | |
|
136 | |
public String getDataFieldHeightValue() { |
137 | 0 | return this.dataFieldHeightValue; |
138 | |
} |
139 | |
|
140 | |
public void setDataFieldHeightValue(String dataFieldHeightValue) { |
141 | 0 | this.dataFieldHeightValue = dataFieldHeightValue; |
142 | 0 | } |
143 | |
|
144 | |
public List<StandardSearchCriteriaField> getFields() { |
145 | 0 | return this.fields; |
146 | |
} |
147 | |
|
148 | |
public void setFields(List<StandardSearchCriteriaField> fields) { |
149 | 0 | this.fields = fields; |
150 | 0 | } |
151 | |
|
152 | |
} |