1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.core.api.uif; |
17 | |
|
18 | |
import org.kuali.rice.core.api.CoreConstants; |
19 | |
import org.w3c.dom.Element; |
20 | |
|
21 | |
import javax.xml.bind.annotation.XmlAccessType; |
22 | |
import javax.xml.bind.annotation.XmlAccessorType; |
23 | |
import javax.xml.bind.annotation.XmlAnyElement; |
24 | |
import javax.xml.bind.annotation.XmlElement; |
25 | |
import javax.xml.bind.annotation.XmlRootElement; |
26 | |
import javax.xml.bind.annotation.XmlType; |
27 | |
import java.util.Collection; |
28 | |
|
29 | |
|
30 | |
|
31 | |
|
32 | |
@XmlRootElement(name = RemotableTextarea.Constants.ROOT_ELEMENT_NAME) |
33 | |
@XmlAccessorType(XmlAccessType.NONE) |
34 | |
@XmlType(name = RemotableTextarea.Constants.TYPE_NAME, propOrder = { |
35 | |
RemotableTextarea.Elements.ROWS, |
36 | |
RemotableTextarea.Elements.COLS, |
37 | |
RemotableTextarea.Elements.WATERMARK, |
38 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS }) |
39 | 4 | public final class RemotableTextarea extends RemotableAbstractControl implements Watermarked, RowsCols { |
40 | |
|
41 | |
@XmlElement(name = Elements.ROWS, required = false) |
42 | |
private final Integer rows; |
43 | |
|
44 | |
@XmlElement(name = Elements.COLS, required = false) |
45 | |
private final Integer cols; |
46 | |
|
47 | |
@XmlElement(name = Elements.WATERMARK, required = false) |
48 | |
private final String watermark; |
49 | |
|
50 | 6 | @SuppressWarnings("unused") |
51 | |
@XmlAnyElement |
52 | |
private final Collection<Element> _futureElements = null; |
53 | |
|
54 | |
|
55 | |
|
56 | |
|
57 | |
@SuppressWarnings("unused") |
58 | 2 | private RemotableTextarea() { |
59 | 2 | rows = null; |
60 | 2 | cols = null; |
61 | 2 | watermark = null; |
62 | 2 | } |
63 | |
|
64 | 4 | private RemotableTextarea(Builder b) { |
65 | 4 | rows = b.rows; |
66 | 4 | cols = b.cols; |
67 | 4 | watermark = b.watermark; |
68 | 4 | } |
69 | |
|
70 | |
@Override |
71 | |
public Integer getRows() { |
72 | 0 | return rows; |
73 | |
} |
74 | |
|
75 | |
@Override |
76 | |
public Integer getCols() { |
77 | 0 | return cols; |
78 | |
} |
79 | |
|
80 | |
@Override |
81 | |
public String getWatermark() { |
82 | 0 | return watermark; |
83 | |
} |
84 | |
|
85 | 16 | public static final class Builder extends RemotableAbstractControl.Builder implements Watermarked, RowsCols { |
86 | |
private Integer rows; |
87 | |
private Integer cols; |
88 | |
private String watermark; |
89 | |
|
90 | |
private Builder() { |
91 | 6 | super(); |
92 | 6 | } |
93 | |
|
94 | |
public static Builder create() { |
95 | 6 | return new Builder(); |
96 | |
} |
97 | |
|
98 | |
@Override |
99 | |
public Integer getRows() { |
100 | 0 | return rows; |
101 | |
} |
102 | |
|
103 | |
public void setRows(Integer rows) { |
104 | 8 | if (rows != null && rows < 1) { |
105 | 1 | throw new IllegalArgumentException("rows was < 1"); |
106 | |
} |
107 | |
|
108 | 7 | this.rows = rows; |
109 | 7 | } |
110 | |
|
111 | |
@Override |
112 | |
public Integer getCols() { |
113 | 0 | return cols; |
114 | |
} |
115 | |
|
116 | |
public void setCols(Integer cols) { |
117 | 8 | if (cols != null && cols < 1) { |
118 | 1 | throw new IllegalArgumentException("cols was < 1"); |
119 | |
} |
120 | |
|
121 | 7 | this.cols = cols; |
122 | 7 | } |
123 | |
|
124 | |
@Override |
125 | |
public String getWatermark() { |
126 | 0 | return watermark; |
127 | |
} |
128 | |
|
129 | |
public void setWatermark(String watermark) { |
130 | 7 | this.watermark = watermark; |
131 | 7 | } |
132 | |
|
133 | |
@Override |
134 | |
public RemotableTextarea build() { |
135 | 4 | return new RemotableTextarea(this); |
136 | |
} |
137 | |
} |
138 | |
|
139 | |
|
140 | |
|
141 | |
|
142 | 0 | static final class Constants { |
143 | |
static final String TYPE_NAME = "TextareaType"; |
144 | |
final static String ROOT_ELEMENT_NAME = "textarea"; |
145 | |
} |
146 | |
|
147 | 0 | static final class Elements { |
148 | |
static final String COLS = "cols"; |
149 | |
static final String ROWS = "rows"; |
150 | |
static final String WATERMARK = "watermark"; |
151 | |
} |
152 | |
} |