1 /**
2 * Copyright 2005-2016 The Kuali Foundation
3 *
4 * Licensed under the Educational Community License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.opensource.org/licenses/ecl2.php
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package org.kuali.rice.krad.uif.field;
17
18 import org.kuali.rice.krad.uif.component.Component;
19 import org.kuali.rice.krad.uif.element.Label;
20
21 import java.util.List;
22
23 /**
24 * Component that contains one or more user interface elements and can be placed
25 * into a <code>Container</code>
26 *
27 * <p>
28 * Provides a wrapper for various user interface elements so they can be treated
29 * uniformly by a container and rendered using a <code>LayoutManager</code>.
30 * Implementations exist for various types of elements and properties to
31 * configure that element.
32 * </p>
33 *
34 * @author Kuali Rice Team (rice.collab@kuali.org)
35 */
36 public interface Field extends Component {
37
38 /**
39 * Label text for the field
40 *
41 * <p>
42 * The label is generally used to identify the field in the user interface
43 * </p>
44 *
45 * @return String label text
46 */
47 public String getLabel();
48
49 /**
50 * Setter for the field's label text
51 *
52 * @param labelText
53 */
54 public void setLabel(String labelText);
55
56 /**
57 * Short label for the field
58 *
59 * <p>
60 * For areas of the user interface that have limited area (such as table
61 * headers), the short label can be used to identify the field
62 * </p>
63 *
64 * @return String short label
65 */
66 public String getShortLabel();
67
68 /**
69 * Setter for the field's short label text
70 *
71 * @param shortLabel
72 */
73 public void setShortLabel(String shortLabel);
74
75 /**
76 * <code>Label</code> instance for the field
77 *
78 * <p>
79 * The label field contains the labeling text for the field in addition to
80 * configuration for rendering in the user interface (such as the styling
81 * for the label area)
82 * </p>
83 *
84 * @return Label instance
85 */
86 public Label getFieldLabel();
87
88 /**
89 * Setter for the field's label field
90 *
91 * @param label
92 */
93 public void setFieldLabel(Label label);
94
95 /**
96 * The label for this field will be positioned to the left of the field content, when true.
97 *
98 * <p>The usage of this option is for one-off instances in which a label must be positioned to the left of a field
99 * for layout purposes. It is recommended that if many fields will have their labels positioned to the left
100 * in a group that a CssGridLabelColumnLayoutManager backed group be used instead.</p>
101 */
102 public boolean isLabelLeft();
103
104 /**
105 * @see Field#isLabelLeft()
106 */
107 public void setLabelLeft(boolean labelLeft);
108
109 /**
110 * Indicates whether the contained <code>Label</code> has been rendered
111 * as part of another field and thus should not be rendered with the
112 * attribute
113 *
114 * @return boolean true if the label field has been rendered, false if it
115 * should be rendered with the attribute
116 */
117 public boolean isLabelRendered();
118
119 /**
120 * Setter for the label field rendered indicator
121 *
122 * @param labelFieldRendered
123 */
124 public void setLabelRendered(boolean labelFieldRendered);
125
126 /**
127 * Label style classes for the field
128 *
129 * @return List<String> label style classes
130 */
131 public List<String> getLabelStyleClasses();
132
133 /**
134 * Setter for the field's label style classes
135 *
136 * @param labelStyleClasses
137 */
138 public void setLabelStyleClasses(List<String> labelStyleClasses);
139
140 /**
141 * Label column span for the field
142 *
143 * @return int label column span
144 */
145 public int getLabelColSpan();
146
147 /**
148 * Setter for the field's label column span
149 *
150 * @param labelColSpan
151 */
152 public void setLabelColSpan(int labelColSpan);
153
154 /**
155 * Field Security object that indicates what authorization (permissions) exist for the field
156 *
157 * @return FieldSecurity instance
158 */
159 public FieldSecurity getFieldSecurity();
160
161 }