001/** 002 * Copyright 2005-2018 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.control; 017 018import org.kuali.rice.krad.uif.widget.DatePicker; 019 020/** 021 * Interface representing a text input control component. 022 * 023 * @author Kuali Rice Team (rice.collab@kuali.org) 024 */ 025public interface TextControl extends Control { 026 027 /** 028 * @see org.kuali.rice.krad.uif.control.SizedControl#getSize() 029 */ 030 int getSize(); 031 032 /** 033 * @see org.kuali.rice.krad.uif.control.SizedControl#setSize(int) 034 */ 035 void setSize(int size); 036 037 /** 038 * Maximum number of characters that can be inputted. 039 * 040 * <p>If not set on control, max length of field will be used</p> 041 * 042 * @return max number of characters 043 */ 044 Integer getMaxLength(); 045 046 /** 047 * @see TextControl#getMaxLength() 048 */ 049 void setMaxLength(Integer maxLength); 050 051 /** 052 * Minimum number of characters that can be inputted. 053 * 054 * <p>If not set on control, min length of field will be used</p> 055 * 056 * @return max number of characters 057 */ 058 Integer getMinLength(); 059 060 /** 061 * @see TextControl#getMinLength() 062 */ 063 void setMinLength(Integer minLength); 064 065 /** 066 * Renders a calendar that can be used to select a date value for the text control. 067 * 068 * @return data picker instance 069 */ 070 DatePicker getDatePicker(); 071 072 /** 073 * @see TextControl#getDatePicker() 074 */ 075 void setDatePicker(DatePicker datePicker); 076 077 /** 078 * If set to true, this control will have a button which can be clicked to expand the text area through 079 * a popup window so the user has more space to type and see the data they are entering in this text field. 080 * 081 * @return boolean if control has text expand enabled, false if not 082 */ 083 boolean isTextExpand(); 084 085 /** 086 * @see TextControl#isTextExpand() 087 */ 088 void setTextExpand(boolean b); 089 090 /** 091 * Gets the watermark text for this TextControl. 092 * 093 * <p>A watermark typically appears as light gray text within the text input element whenever the 094 * element is empty and does not have focus. This provides a hint to the user as to what the input 095 * is used for, or the type of input that is required.</p> 096 * 097 * @return the watermarkText 098 */ 099 String getWatermarkText(); 100 101 /** 102 * @see TextControl#getWatermarkText() 103 */ 104 void setWatermarkText(String watermark); 105 106}