001package com.hfg.html; 002 003 004//------------------------------------------------------------------------------ 005/** 006 * Represents a password form element (<input type='password'>) tag. 007 * 008 * @author J. Alex Taylor, hairyfatguy.com 009 */ 010//------------------------------------------------------------------------------ 011// com.hfg XML/HTML Coding Library 012// 013// This library is free software; you can redistribute it and/or 014// modify it under the terms of the GNU Lesser General Public 015// License as published by the Free Software Foundation; either 016// version 2.1 of the License, or (at your option) any later version. 017// 018// This library is distributed in the hope that it will be useful, 019// but WITHOUT ANY WARRANTY; without even the implied warranty of 020// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 021// Lesser General Public License for more details. 022// 023// You should have received a copy of the GNU Lesser General Public 024// License along with this library; if not, write to the Free Software 025// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 026// 027// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 028// jataylor@hairyfatguy.com 029//------------------------------------------------------------------------------ 030 031public class InputPassword extends HTMLTagWithFormEvents 032{ 033 034 //########################################################################## 035 // PRIVATE FIELDS 036 //########################################################################## 037 038 039 //########################################################################## 040 // CONSTRUCTORS 041 //########################################################################## 042 043 //-------------------------------------------------------------------------- 044 public InputPassword() 045 { 046 super(HTML.INPUT); 047 setAttribute(HTML.TYPE, HTML.PASSWORD); 048 } 049 050 //-------------------------------------------------------------------------- 051 public InputPassword(String inName, String inValue) 052 { 053 this(); 054 setName(inName); 055 setValue(inValue); 056 } 057 058 //########################################################################## 059 // PUBLIC METHODS 060 //########################################################################## 061 062 //-------------------------------------------------------------------------- 063 public InputPassword setSize(int inValue) 064 { 065 setAttribute(HTML.SIZE, Integer.toString(inValue)); 066 067 return this; 068 } 069 070 //-------------------------------------------------------------------------- 071 public InputPassword setMaxLength(int inValue) 072 { 073 setAttribute(HTML.MAX_LENGTH, Integer.toString(inValue)); 074 075 return this; 076 } 077 078 079 //-------------------------------------------------------------------------- 080 public InputPassword setName(String inValue) 081 { 082 setAttribute(HTML.NAME, inValue); 083 084 return this; 085 } 086 087 //-------------------------------------------------------------------------- 088 public String getName() 089 { 090 return getAttributeValue(HTML.NAME); 091 } 092 093 //-------------------------------------------------------------------------- 094 public InputPassword setValue(String inValue) 095 { 096 setAttribute(HTML.VALUE, inValue); 097 098 return this; 099 } 100 101 //-------------------------------------------------------------------------- 102 public String getValue() 103 { 104 return getAttributeValue(HTML.VALUE); 105 } 106 107 // Overrides for HTMLTag setters to allow method chaining. 108 109 //-------------------------------------------------------------------------- 110 @Override 111 public InputPassword setId(String inValue) 112 { 113 return (InputPassword) super.setId(inValue); 114 } 115 116 //-------------------------------------------------------------------------- 117 @Override 118 public InputPassword setStyle(CharSequence inValue) 119 { 120 return (InputPassword) super.setStyle(inValue); 121 } 122 123 //-------------------------------------------------------------------------- 124 @Override 125 public InputPassword addStyle(String inValue) 126 { 127 return (InputPassword) super.addStyle(inValue); 128 } 129 130 // Overrides for HTMLTagWithCoreEvents setters to allow method chaining. 131 132 //-------------------------------------------------------------------------- 133 @Override 134 public InputPassword setOnClick(String inValue) 135 { 136 return (InputPassword) super.setOnClick(inValue); 137 } 138 139 //-------------------------------------------------------------------------- 140 @Override 141 public InputPassword setOnDblClick(String inValue) 142 { 143 return (InputPassword) super.setOnDblClick(inValue); 144 } 145 146 //-------------------------------------------------------------------------- 147 @Override 148 public InputPassword setOnMouseDown(String inValue) 149 { 150 return (InputPassword) super.setOnMouseDown(inValue); 151 } 152 153 //-------------------------------------------------------------------------- 154 @Override 155 public InputPassword setOnMouseMove(String inValue) 156 { 157 return (InputPassword) super.setOnMouseMove(inValue); 158 } 159 160 //-------------------------------------------------------------------------- 161 @Override 162 public InputPassword setOnMouseOut(String inValue) 163 { 164 return (InputPassword) super.setOnMouseOut(inValue); 165 } 166 167 //-------------------------------------------------------------------------- 168 @Override 169 public InputPassword setOnMouseOver(String inValue) 170 { 171 return (InputPassword) super.setOnMouseOver(inValue); 172 } 173 174 //-------------------------------------------------------------------------- 175 @Override 176 public InputPassword setOnMouseUp(String inValue) 177 { 178 return (InputPassword) super.setOnMouseUp(inValue); 179 } 180 181 //-------------------------------------------------------------------------- 182 @Override 183 public InputPassword setOnKeyDown(String inValue) 184 { 185 return (InputPassword) super.setOnKeyDown(inValue); 186 } 187 188 //-------------------------------------------------------------------------- 189 @Override 190 public InputPassword setOnKeyPress(String inValue) 191 { 192 return (InputPassword) super.setOnKeyPress(inValue); 193 } 194 195 //-------------------------------------------------------------------------- 196 @Override 197 public InputPassword setOnKeyUp(String inValue) 198 { 199 return (InputPassword) super.setOnKeyUp(inValue); 200 } 201 202 // Overrides for HTMLTagWithFormEvents setters to allow method chaining. 203 204 //-------------------------------------------------------------------------- 205 @Override 206 public InputPassword setOnBlur(String inValue) 207 { 208 return (InputPassword) super.setOnBlur(inValue); 209 } 210 211 //-------------------------------------------------------------------------- 212 @Override 213 public InputPassword setOnChange(String inValue) 214 { 215 return (InputPassword) super.setOnChange(inValue); 216 } 217 218 //-------------------------------------------------------------------------- 219 @Override 220 public InputPassword setOnFocus(String inValue) 221 { 222 return (InputPassword) super.setOnFocus(inValue); 223 } 224 225}