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.control; 17 18 import org.kuali.rice.krad.uif.widget.DatePicker; 19 20 /** 21 * Interface representing a text input control component. 22 * 23 * @author Kuali Rice Team (rice.collab@kuali.org) 24 */ 25 public interface TextControl extends Control { 26 27 /** 28 * @see org.kuali.rice.krad.uif.control.SizedControl#getSize() 29 */ 30 int getSize(); 31 32 /** 33 * @see org.kuali.rice.krad.uif.control.SizedControl#setSize(int) 34 */ 35 void setSize(int size); 36 37 /** 38 * Maximum number of characters that can be inputted. 39 * 40 * <p>If not set on control, max length of field will be used</p> 41 * 42 * @return max number of characters 43 */ 44 Integer getMaxLength(); 45 46 /** 47 * @see TextControl#getMaxLength() 48 */ 49 void setMaxLength(Integer maxLength); 50 51 /** 52 * Minimum number of characters that can be inputted. 53 * 54 * <p>If not set on control, min length of field will be used</p> 55 * 56 * @return max number of characters 57 */ 58 Integer getMinLength(); 59 60 /** 61 * @see TextControl#getMinLength() 62 */ 63 void setMinLength(Integer minLength); 64 65 /** 66 * Renders a calendar that can be used to select a date value for the text control. 67 * 68 * @return data picker instance 69 */ 70 DatePicker getDatePicker(); 71 72 /** 73 * @see TextControl#getDatePicker() 74 */ 75 void setDatePicker(DatePicker datePicker); 76 77 /** 78 * If set to true, this control will have a button which can be clicked to expand the text area through 79 * a popup window so the user has more space to type and see the data they are entering in this text field. 80 * 81 * @return boolean if control has text expand enabled, false if not 82 */ 83 boolean isTextExpand(); 84 85 /** 86 * @see TextControl#isTextExpand() 87 */ 88 void setTextExpand(boolean b); 89 90 /** 91 * Gets the watermark text for this TextControl. 92 * 93 * <p>A watermark typically appears as light gray text within the text input element whenever the 94 * element is empty and does not have focus. This provides a hint to the user as to what the input 95 * is used for, or the type of input that is required.</p> 96 * 97 * @return the watermarkText 98 */ 99 String getWatermarkText(); 100 101 /** 102 * @see TextControl#getWatermarkText() 103 */ 104 void setWatermarkText(String watermark); 105 106 }