001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.uif.field;
017
018import org.kuali.rice.krad.uif.component.Component;
019import org.kuali.rice.krad.uif.element.Label;
020
021import java.util.List;
022
023/**
024 * Component that contains one or more user interface elements and can be placed
025 * into a <code>Container</code>
026 *
027 * <p>
028 * Provides a wrapper for various user interface elements so they can be treated
029 * uniformly by a container and rendered using a <code>LayoutManager</code>.
030 * Implementations exist for various types of elements and properties to
031 * configure that element.
032 * </p>
033 *
034 * @author Kuali Rice Team (rice.collab@kuali.org)
035 */
036public interface Field extends Component {
037
038        /**
039         * Label text for the field
040         *
041         * <p>
042         * The label is generally used to identify the field in the user interface
043         * </p>
044         *
045         * @return String label text
046         */
047        public String getLabel();
048
049        /**
050         * Setter for the field's label text
051         *
052         * @param labelText
053         */
054        public void setLabel(String labelText);
055
056        /**
057         * Short label for the field
058         *
059         * <p>
060         * For areas of the user interface that have limited area (such as table
061         * headers), the short label can be used to identify the field
062         * </p>
063         *
064         * @return String short label
065         */
066        public String getShortLabel();
067
068        /**
069         * Setter for the field's short label text
070         *
071         * @param shortLabel
072         */
073        public void setShortLabel(String shortLabel);
074
075        /**
076         * <code>Label</code> instance for the field
077         *
078         * <p>
079         * The label field contains the labeling text for the field in addition to
080         * configuration for rendering in the user interface (such as the styling
081         * for the label area)
082         * </p>
083         *
084         * @return Label instance
085         */
086        public Label getFieldLabel();
087
088        /**
089         * Setter for the field's label field
090         *
091         * @param label
092         */
093        public void setFieldLabel(Label label);
094
095        /**
096         * Indicates whether the contained <code>Label</code> has been rendered
097         * as part of another field and thus should not be rendered with the
098         * attribute
099         *
100         * @return boolean true if the label field has been rendered, false if it
101         *         should be rendered with the attribute
102         */
103        public boolean isLabelRendered();
104
105        /**
106         * Setter for the label field rendered indicator
107         *
108         * @param labelFieldRendered
109         */
110        public void setLabelRendered(boolean labelFieldRendered);
111
112    /**
113     * Label style classes for the field
114     *
115     * @return List<String> label style classes
116     */
117    public List<String> getLabelStyleClasses();
118
119    /**
120     * Setter for the field's label style classes
121     *
122     * @param labelStyleClasses
123     */
124    public void setLabelStyleClasses(List<String> labelStyleClasses);
125
126    /**
127     * Label column span for the field
128     *
129     * @return int label column span
130     */
131    public int getLabelColSpan();
132
133    /**
134     * Setter for the field's label column span
135     *
136     * @param labelColSpan
137     */
138    public void setLabelColSpan(int labelColSpan);
139
140    /**
141     * Field Security object that indicates what authorization (permissions) exist for the field
142     *
143     * @return FieldSecurity instance
144     */
145    public FieldSecurity getFieldSecurity();
146
147}