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