001// *************************************************************************************************************************** 002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file * 003// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file * 004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance * 005// * with the License. You may obtain a copy of the License at * 006// * * 007// * http://www.apache.org/licenses/LICENSE-2.0 * 008// * * 009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an * 010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * 011// * specific language governing permissions and limitations under the License. * 012// *************************************************************************************************************************** 013package org.apache.juneau.dto.html5; 014 015import org.apache.juneau.annotation.*; 016 017/** 018 * DTO for an HTML {@doc HTML5.forms#the-textarea-element <textarea>} 019 * element. 020 * 021 * <ul class='seealso'> 022 * <li class='link'>{@doc juneau-dto.HTML5} 023 * </ul> 024 */ 025@Bean(typeName="textarea") 026public class Textarea extends HtmlElementRawText { 027 028 /** 029 * {@doc HTML5.forms#attr-fe-autocomplete autocomplete} attribute. 030 * 031 * <p> 032 * Hint for form auto-fill feature. 033 * 034 * @param autocomplete The new value for this attribute. 035 * @return This object (for method chaining). 036 */ 037 public final Textarea autocomplete(String autocomplete) { 038 attr("autocomplete", autocomplete); 039 return this; 040 } 041 042 /** 043 * {@doc HTML5.forms#attr-fe-autofocus autofocus} attribute. 044 * 045 * <p> 046 * Automatically focus the form control when the page is loaded. 047 * 048 * @param autofocus 049 * The new value for this attribute. 050 * Typically a {@link Boolean} or {@link String}. 051 * @return This object (for method chaining). 052 */ 053 public final Textarea autofocus(Boolean autofocus) { 054 attr("autofocus", autofocus); 055 return this; 056 } 057 058 /** 059 * {@doc HTML5.forms#attr-textarea-cols cols} attribute. 060 * 061 * <p> 062 * Maximum number of characters per line. 063 * 064 * @param cols 065 * The new value for this attribute. 066 * Typically a {@link Number} or {@link String}. 067 * @return This object (for method chaining). 068 */ 069 public final Textarea cols(Object cols) { 070 attr("cols", cols); 071 return this; 072 } 073 074 /** 075 * {@doc HTML5.forms#attr-fe-dirname dirname} attribute. 076 * 077 * <p> 078 * Name of form field to use for sending the element's directionality in form submission. 079 * 080 * @param dirname The new value for this attribute. 081 * @return This object (for method chaining). 082 */ 083 public final Textarea dirname(String dirname) { 084 attr("dirname", dirname); 085 return this; 086 } 087 088 /** 089 * {@doc HTML5.forms#attr-fe-disabled disabled} attribute. 090 * 091 * <p> 092 * Whether the form control is disabled. 093 * 094 * @param disabled 095 * The new value for this attribute. 096 * Typically a {@link Boolean} or {@link String}. 097 * @return This object (for method chaining). 098 */ 099 public final Textarea disabled(Object disabled) { 100 attr("disabled", deminimize(disabled, "disabled")); 101 return this; 102 } 103 104 /** 105 * {@doc HTML5.forms#attr-fae-form form} attribute. 106 * 107 * <p> 108 * Associates the control with a form element. 109 * 110 * @param form The new value for this attribute. 111 * @return This object (for method chaining). 112 */ 113 public final Textarea form(String form) { 114 attr("form", form); 115 return this; 116 } 117 118 /** 119 * {@doc HTML5.forms#inputmode inputmode} attribute. 120 * 121 * <p> 122 * Hint for selecting an input modality. 123 * 124 * @param inputmode The new value for this attribute. 125 * @return This object (for method chaining). 126 */ 127 public final Textarea inputmode(String inputmode) { 128 attr("inputmode", inputmode); 129 return this; 130 } 131 132 /** 133 * {@doc HTML5.forms#attr-textarea-maxlength maxlength} attribute. 134 * 135 * <p> 136 * Maximum length of value. 137 * 138 * @param maxlength 139 * The new value for this attribute. 140 * Typically a {@link Number} or {@link String}. 141 * @return This object (for method chaining). 142 */ 143 public final Textarea maxlength(Object maxlength) { 144 attr("maxlength", maxlength); 145 return this; 146 } 147 148 /** 149 * {@doc HTML5.forms#attr-textarea-minlength minlength} attribute. 150 * 151 * <p> 152 * Minimum length of value. 153 * 154 * @param minlength 155 * The new value for this attribute. 156 * Typically a {@link Number} or {@link String}. 157 * @return This object (for method chaining). 158 */ 159 public final Textarea minlength(Object minlength) { 160 attr("minlength", minlength); 161 return this; 162 } 163 164 /** 165 * {@doc HTML5.forms#attr-fe-name name} attribute. 166 * 167 * <p> 168 * Name of form control to use for form submission and in the form.elements API. 169 * 170 * @param name The new value for this attribute. 171 * @return This object (for method chaining). 172 */ 173 public final Textarea name(String name) { 174 attr("name", name); 175 return this; 176 } 177 178 /** 179 * {@doc HTML5.forms#attr-textarea-placeholder placeholder} 180 * attribute. 181 * 182 * <p> 183 * User-visible label to be placed within the form control. 184 * 185 * @param placeholder The new value for this attribute. 186 * @return This object (for method chaining). 187 */ 188 public final Textarea placeholder(String placeholder) { 189 attr("placeholder", placeholder); 190 return this; 191 } 192 193 /** 194 * {@doc HTML5.forms#attr-textarea-readonly readonly} attribute. 195 * 196 * <p> 197 * Whether to allow the value to be edited by the user. 198 * 199 * @param readonly 200 * The new value for this attribute. 201 * Typically a {@link Boolean} or {@link String}. 202 * @return This object (for method chaining). 203 */ 204 public final Textarea readonly(Object readonly) { 205 attr("readonly", readonly); 206 return this; 207 } 208 209 /** 210 * {@doc HTML5.forms#attr-textarea-required required} attribute. 211 * 212 * <p> 213 * Whether the control is required for form submission. 214 * 215 * @param required 216 * The new value for this attribute. 217 * Typically a {@link Boolean} or {@link String}. 218 * @return This object (for method chaining). 219 */ 220 public final Textarea required(Object required) { 221 attr("required", required); 222 return this; 223 } 224 225 /** 226 * {@doc HTML5.forms#attr-textarea-rows rows} attribute. 227 * 228 * <p> 229 * Number of lines to show. 230 * 231 * @param rows 232 * The new value for this attribute. 233 * Typically a {@link Number} or {@link String}. 234 * @return This object (for method chaining). 235 */ 236 public final Textarea rows(Number rows) { 237 attr("rows", rows); 238 return this; 239 } 240 241 /** 242 * {@doc HTML5.forms#attr-textarea-wrap wrap} attribute. 243 * 244 * <p> 245 * How the value of the form control is to be wrapped for form submission. 246 * 247 * @param wrap The new value for this attribute. 248 * @return This object (for method chaining). 249 */ 250 public final Textarea wrap(String wrap) { 251 attr("wrap", wrap); 252 return this; 253 } 254 255 256 //----------------------------------------------------------------------------------------------------------------- 257 // Overridden methods 258 //----------------------------------------------------------------------------------------------------------------- 259 260 @Override /* HtmlElement */ 261 public final Textarea _class(String _class) { 262 super._class(_class); 263 return this; 264 } 265 266 @Override /* HtmlElement */ 267 public final Textarea id(String id) { 268 super.id(id); 269 return this; 270 } 271 272 @Override /* HtmlElement */ 273 public final Textarea style(String style) { 274 super.style(style); 275 return this; 276 } 277 278 @Override /* HtmlElementText */ 279 public Textarea text(Object text) { 280 super.text(text); 281 return this; 282 } 283}