Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
TextAreaControl |
|
| 1.1428571428571428;1.143 |
1 | /* | |
2 | * Copyright 2007 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 1.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/ecl1.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.kns.uif.control; | |
17 | ||
18 | import org.apache.commons.lang.StringUtils; | |
19 | ||
20 | /** | |
21 | * Represents a HTML TextArea control. Generally used for values that are very | |
22 | * large (such as a description) | |
23 | * | |
24 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
25 | */ | |
26 | public class TextAreaControl extends ControlBase { | |
27 | private static final long serialVersionUID = -4664558047325456844L; | |
28 | ||
29 | private int rows; | |
30 | private int cols; | |
31 | 0 | private String watermarkText = StringUtils.EMPTY; |
32 | ||
33 | 0 | public TextAreaControl() { |
34 | ||
35 | 0 | } |
36 | ||
37 | /** | |
38 | * Number of rows the control should span (horizontal length) | |
39 | * | |
40 | * @return int number of rows | |
41 | */ | |
42 | public int getRows() { | |
43 | 0 | return this.rows; |
44 | } | |
45 | ||
46 | public void setRows(int rows) { | |
47 | 0 | this.rows = rows; |
48 | 0 | } |
49 | ||
50 | /** | |
51 | * Number of columns the control should span (vertical length) | |
52 | * | |
53 | * @return int number of columns | |
54 | */ | |
55 | public int getCols() { | |
56 | 0 | return this.cols; |
57 | } | |
58 | ||
59 | public void setCols(int cols) { | |
60 | 0 | this.cols = cols; |
61 | 0 | } |
62 | ||
63 | /** | |
64 | * @return the watermarkText | |
65 | */ | |
66 | public String getWatermarkText() { | |
67 | 0 | return this.watermarkText; |
68 | } | |
69 | ||
70 | /** | |
71 | * @param watermarkText the watermarkText to set | |
72 | */ | |
73 | public void setWatermarkText(String watermarkText) { | |
74 | //to avoid users from putting in the same value as the watermark adding some spaces here | |
75 | //see watermark troubleshooting for more info | |
76 | 0 | if (StringUtils.isNotEmpty(watermarkText)) { |
77 | 0 | watermarkText = watermarkText + " "; |
78 | } | |
79 | 0 | this.watermarkText = watermarkText; |
80 | 0 | } |
81 | ||
82 | } |