001: package org.gridsphere.provider.portletui.tags;
002:
003: import org.gridsphere.provider.portletui.beans.ValidatorBean;
004:
005: import javax.servlet.jsp.JspException;
006: import java.util.ArrayList;
007: import java.util.List;
008:
009: /**
010: * A <code>TextFieldTag</code> represents a text field element
011: */
012: public abstract class InputTag extends BaseComponentTag {
013:
014: protected List<ValidatorBean> validatorBeans = new ArrayList<ValidatorBean>();
015:
016: protected String onFocus = null;
017: protected String onClick = null;
018: protected String onDblClick = null;
019: protected String onChange = null;
020: protected String onBlur = null;
021: protected String onSelect = null;
022:
023: protected String onmousedown = null;
024: protected String onmousemove = null;
025: protected String onmouseout = null;
026: protected String onmouseover = null;
027: protected String onmouseup = null;
028:
029: /**
030: * Sets the onFocus JavaScript function
031: *
032: * @param onFocus the onFocus JavaScript function
033: */
034: public void setOnFocus(String onFocus) {
035: this .onFocus = onFocus;
036: }
037:
038: /**
039: * Returns the onFocus JavaScript function
040: *
041: * @return onFocus JavaScript function
042: */
043: public String getOnFocus() {
044: return onFocus;
045: }
046:
047: /**
048: * Returns the onClick javascript function
049: *
050: * @return the onClick javascript function
051: */
052: public String getOnClick() {
053: return onClick;
054: }
055:
056: /**
057: * Sets the onClick JavaScript function
058: *
059: * @param onClick the onClick JavaScript function
060: */
061: public void setOnClick(String onClick) {
062: this .onClick = onClick;
063: }
064:
065: /**
066: * Returns the onDblClick javascript function
067: *
068: * @return the onDblClick javascript function
069: */
070: public String getOnDblClick() {
071: return onDblClick;
072: }
073:
074: /**
075: * Sets the onDblClick JavaScript function
076: *
077: * @param onDblClick the onDblClick JavaScript function
078: */
079: public void setOnDblClick(String onDblClick) {
080: this .onDblClick = onDblClick;
081: }
082:
083: /**
084: * Returns the onChange JavaScript function
085: *
086: * @return onChange JavaScript function
087: */
088: public String getOnChange() {
089: return onChange;
090: }
091:
092: /**
093: * Sets the onChange JavaScript function
094: *
095: * @param onChange the onChange JavaScript function
096: */
097: public void setOnChange(String onChange) {
098: this .onChange = onChange;
099: }
100:
101: /**
102: * Returns the onBlur JavaScript function
103: *
104: * @return onBlur JavaScript function
105: */
106: public String getOnBlur() {
107: return onBlur;
108: }
109:
110: /**
111: * Sets the onBlur JavaScript function
112: *
113: * @param onBlur the onBlur JavaScript function
114: */
115: public void setOnBlur(String onBlur) {
116: this .onBlur = onBlur;
117: }
118:
119: /**
120: * Returns the onSelect JavaScript function
121: *
122: * @return onSelect JavaScript function
123: */
124: public String getOnSelect() {
125: return onSelect;
126: }
127:
128: /**
129: * Sets the onSelect JavaScript function
130: *
131: * @param onSelect the onSelect JavaScript function
132: */
133: public void setOnSelect(String onSelect) {
134: this .onSelect = onSelect;
135: }
136:
137: /**
138: * Returns the onmousedown event
139: *
140: * @return the onmousedown function
141: */
142: public String getOnMouseDown() {
143: return onmousedown;
144: }
145:
146: /**
147: * Sets the onmousedown event
148: *
149: * @param onmousedown the onmousedown function
150: */
151: public void setOnMouseDown(String onmousedown) {
152: this .onmousedown = onmousedown;
153: }
154:
155: /**
156: * Returns the onmousemove function
157: *
158: * @return the onmousemove function
159: */
160: public String getOnMouseMove() {
161: return onmousemove;
162: }
163:
164: /**
165: * Sets the onmousemove function
166: *
167: * @param onmousemove the onmousemove function
168: */
169: public void setOnMouseMove(String onmousemove) {
170: this .onmousemove = onmousemove;
171: }
172:
173: /**
174: * Returns the onmouseout function
175: *
176: * @return the onmouseout function
177: */
178: public String getOnMouseOut() {
179: return onmouseout;
180: }
181:
182: /**
183: * Sets the onmouseout function
184: *
185: * @param onmouseout the onmouseout function
186: */
187: public void setOnMouseOut(String onmouseout) {
188: this .onmouseout = onmouseout;
189: }
190:
191: /**
192: * Returns the onmouseover function
193: *
194: * @return the onmouseover function
195: */
196: public String getOnMouseOver() {
197: return onmouseover;
198: }
199:
200: /**
201: * Sets the onmouseover javascript function
202: *
203: * @param onmouseover the onmouseover function
204: */
205: public void setOnMouseOver(String onmouseover) {
206: this .onmouseover = onmouseover;
207: }
208:
209: /**
210: * Returns the onMouseUp javascript function
211: *
212: * @return the onmouseup event
213: */
214: public String getOnMouseUp() {
215: return onmouseup;
216: }
217:
218: /**
219: * Sets the onMouseUp javascript function
220: *
221: * @param onmouseup a mouseup event
222: */
223: public void setOnMouseUp(String onmouseup) {
224: this .onmouseup = onmouseup;
225: }
226:
227: public abstract int doStartTag() throws JspException;
228:
229: public abstract int doEndTag() throws JspException;
230:
231: public void addValidatorBean(ValidatorBean validatorBean) {
232: validatorBeans.add(validatorBean);
233: }
234:
235: }
|