KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lobobrowser > html > domimpl > HTMLTextAreaElementImpl


1 /*
2     GNU LESSER GENERAL PUBLIC LICENSE
3     Copyright (C) 2006 The Lobo Project
4
5     This library is free software; you can redistribute it and/or
6     modify it under the terms of the GNU Lesser General Public
7     License as published by the Free Software Foundation; either
8     version 2.1 of the License, or (at your option) any later version.
9
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13     Lesser General Public License for more details.
14
15     You should have received a copy of the GNU Lesser General Public
16     License along with this library; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18
19     Contact info: xamjadmin@users.sourceforge.net
20 */

21 /*
22  * Created on Jan 15, 2006
23  */

24 package org.lobobrowser.html.domimpl;
25
26 import java.io.UnsupportedEncodingException JavaDoc;
27
28 import org.lobobrowser.html.FormInput;
29 import org.w3c.dom.html2.HTMLFormElement;
30 import org.w3c.dom.html2.HTMLTextAreaElement;
31
32 public class HTMLTextAreaElementImpl extends HTMLBaseInputElement implements
33         HTMLTextAreaElement {
34     public HTMLTextAreaElementImpl(String JavaDoc name) {
35         super(name);
36     }
37
38     public HTMLTextAreaElementImpl() {
39         super("TEXTAREA");
40     }
41     
42     protected FormInput[] getFormInputs() {
43         String JavaDoc name = this.getName();
44         if(name == null) {
45             return null;
46         }
47         return new FormInput[] { new FormInput(name, this.getValue()) };
48     }
49
50     /* (non-Javadoc)
51      * @see org.w3c.dom.html2.HTMLTextAreaElement#getCols()
52      */

53     public int getCols() {
54         InputContext ic = this.inputContext;
55         return ic == null ? 0 : ic.getCols();
56     }
57
58     /* (non-Javadoc)
59      * @see org.w3c.dom.html2.HTMLTextAreaElement#getRows()
60      */

61     public int getRows() {
62         InputContext ic = this.inputContext;
63         return ic == null ? 0 : ic.getRows();
64     }
65
66     /* (non-Javadoc)
67      * @see org.w3c.dom.html2.HTMLTextAreaElement#getType()
68      */

69     public String JavaDoc getType() {
70         return "textarea";
71     }
72
73     /* (non-Javadoc)
74      * @see org.w3c.dom.html2.HTMLTextAreaElement#setCols(int)
75      */

76     public void setCols(int cols) {
77         InputContext ic = this.inputContext;
78         if(ic != null) {
79             ic.setCols(cols);
80         }
81     }
82
83     /* (non-Javadoc)
84      * @see org.w3c.dom.html2.HTMLTextAreaElement#setRows(int)
85      */

86     public void setRows(int rows) {
87         InputContext ic = this.inputContext;
88         if(ic != null) {
89             ic.setRows(rows);
90         }
91     }
92 }
93
Popular Tags