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 <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#the-select-element"><select></a> 019 * element. 020 * 021 * <h5 class='section'>See Also:</h5> 022 * <ul class='doctree'> 023 * <li class='link'><a class='doclink' href='../../../../../overview-summary.html#juneau-dto.HTML5'>Overview > juneau-dto > HTML5</a> 024 * </ul> 025 */ 026@Bean(typeName="select") 027public class Select extends HtmlElementContainer { 028 029 /** 030 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-autofocus">autofocus</a> attribute. 031 * 032 * <p> 033 * Automatically focus the form control when the page is loaded. 034 * 035 * @param autofocus 036 * The new value for this attribute. 037 * Typically a {@link Boolean} or {@link String}. 038 * @return This object (for method chaining). 039 */ 040 public final Select autofocus(Object autofocus) { 041 attr("autofocus", autofocus); 042 return this; 043 } 044 045 /** 046 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-disabled">disabled</a> attribute. 047 * 048 * <p> 049 * Whether the form control is disabled. 050 * 051 * @param disabled 052 * The new value for this attribute. 053 * Typically a {@link Boolean} or {@link String}. 054 * @return This object (for method chaining). 055 */ 056 public final Select disabled(Object disabled) { 057 attr("disabled", disabled); 058 return this; 059 } 060 061 /** 062 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fae-form">form</a> attribute. 063 * 064 * <p> 065 * Associates the control with a form element. 066 * 067 * @param form The new value for this attribute. 068 * @return This object (for method chaining). 069 */ 070 public final Select form(String form) { 071 attr("form", form); 072 return this; 073 } 074 075 /** 076 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-select-multiple">multiple</a> attribute. 077 * 078 * <p> 079 * Whether to allow multiple values. 080 * 081 * @param multiple 082 * The new value for this attribute. 083 * Typically a {@link Boolean} or {@link String}. 084 * @return This object (for method chaining). 085 */ 086 public final Select multiple(Object multiple) { 087 attr("multiple", multiple); 088 return this; 089 } 090 091 /** 092 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-fe-name">name</a> attribute. 093 * 094 * <p> 095 * Name of form control to use for form submission and in the form.elements API. 096 * 097 * @param name The new value for this attribute. 098 * @return This object (for method chaining). 099 */ 100 public final Select name(String name) { 101 attr("name", name); 102 return this; 103 } 104 105 /** 106 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-select-required">required</a> attribute. 107 * 108 * <p> 109 * Whether the control is required for form submission. 110 * 111 * @param required 112 * The new value for this attribute. 113 * Typically a {@link Boolean} or {@link String}. 114 * @return This object (for method chaining). 115 */ 116 public final Select required(Object required) { 117 attr("required", required); 118 return this; 119 } 120 121 /** 122 * <a class="doclink" href="https://www.w3.org/TR/html5/forms.html#attr-select-size">size</a> attribute. 123 * 124 * <p> 125 * Size of the control. 126 * 127 * @param size 128 * The new value for this attribute. 129 * Typically a {@link Number} or {@link String}. 130 * @return This object (for method chaining). 131 */ 132 public final Select size(Object size) { 133 attr("size", size); 134 return this; 135 } 136 137 138 //-------------------------------------------------------------------------------- 139 // Overridden methods 140 //-------------------------------------------------------------------------------- 141 142 @Override /* HtmlElement */ 143 public final Select _class(String _class) { 144 super._class(_class); 145 return this; 146 } 147 148 @Override /* HtmlElement */ 149 public final Select id(String id) { 150 super.id(id); 151 return this; 152 } 153 154 @Override /* HtmlElement */ 155 public final Select style(String style) { 156 super.style(style); 157 return this; 158 } 159 160 @Override /* HtmlElementContainer */ 161 public final Select children(Object...children) { 162 super.children(children); 163 return this; 164 } 165 166 @Override /* HtmlElementContainer */ 167 public final Select child(Object child) { 168 super.child(child); 169 return this; 170 } 171}