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 ExtHTML5.forms#the-optgroup-element <optgroup>}
019 * element.
020 *
021 * <ul class='seealso'>
022 *    <li class='link'>{@doc DtoHtml5}
023 * </ul>
024 */
025@Bean(typeName="optgroup")
026public class Optgroup extends HtmlElementContainer {
027
028   /**
029    * Creates an empty {@link Optgroup} element.
030    */
031   public Optgroup() {}
032
033   /**
034    * Creates an {@link Optgroup} element with the specified child nodes.
035    *
036    * @param children The child nodes.
037    */
038   public Optgroup(Object...children) {
039      children(children);
040   }
041
042   /**
043    * {@doc ExtHTML5.forms#attr-optgroup-disabled disabled} attribute.
044    *
045    * <p>
046    * Whether the form control is disabled.
047    *
048    * @param disabled
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 Optgroup disabled(Object disabled) {
054      attr("disabled", deminimize(disabled, "disabled"));
055      return this;
056   }
057
058   /**
059    * {@doc ExtHTML5.forms#attr-optgroup-label label} attribute.
060    *
061    * <p>
062    * User-visible label.
063    *
064    * @param label The new value for this attribute.
065    * @return This object (for method chaining).
066    */
067   public final Optgroup label(String label) {
068      attr("label", label);
069      return this;
070   }
071
072
073   //-----------------------------------------------------------------------------------------------------------------
074   // Overridden methods
075   //-----------------------------------------------------------------------------------------------------------------
076
077   @Override /* HtmlElement */
078   public final Optgroup _class(String _class) {
079      super._class(_class);
080      return this;
081   }
082
083   @Override /* HtmlElement */
084   public final Optgroup id(String id) {
085      super.id(id);
086      return this;
087   }
088
089   @Override /* HtmlElement */
090   public final Optgroup style(String style) {
091      super.style(style);
092      return this;
093   }
094
095   @Override /* HtmlElementContainer */
096   public final Optgroup children(Object...children) {
097      super.children(children);
098      return this;
099   }
100
101   @Override /* HtmlElementContainer */
102   public final Optgroup child(Object child) {
103      super.child(child);
104      return this;
105   }
106}