001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache License, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. You may obtain a copy of the License at 008 * 009 * http://www.apache.org/licenses/LICENSE-2.0 010 * 011 * Unless required by applicable law or agreed to in writing, software 012 * distributed under the License is distributed on an "AS IS" BASIS, 013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 014 * See the License for the specific language governing permissions and 015 * limitations under the License. 016 */ 017package org.apache.juneau.bean.html5; 018 019import org.apache.juneau.marshall.*; 020 021/** 022 * DTO for an HTML <a class="doclink" href="https://www.w3.org/TR/html5/grouping-content.html#the-ul-element"><ul></a> 023 * element. 024 * 025 * <p> 026 * The ul element represents an unordered list of items. It is used to group a collection of items that 027 * do not have a numerical ordering and whose order in the list is not meaningful. The ul element contains 028 * li (list item) elements, and is commonly used for navigation menus, feature lists, and other collections 029 * where the order of items is not important. 030 * 031 * <h5 class='section'>Examples:</h5> 032 * <p class='bcode w800'> 033 * <jk>import static</jk> org.apache.juneau.bean.html5.HtmlBuilder.*; 034 * 035 * <jc>// Simple unordered list</jc> 036 * Ul <jv>simple</jv> = <jsm>ul</jsm>( 037 * <jsm>li</jsm>(<js>"First item"</js>), 038 * <jsm>li</jsm>(<js>"Second item"</js>), 039 * <jsm>li</jsm>(<js>"Third item"</js>) 040 * ); 041 * 042 * <jc>// Navigation menu</jc> 043 * Ul <jv>navigation</jv> = <jsm>ul</jsm>( 044 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/home"</js>, <js>"Home"</js>)), 045 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/about"</js>, <js>"About"</js>)), 046 * <jsm>li</jsm>(<jsm>a</jsm>(<js>"/contact"</js>, <js>"Contact"</js>)) 047 * ).class_(<js>"nav-menu"</js>); 048 * 049 * <jc>// Feature list</jc> 050 * Ul <jv>features</jv> = <jsm>ul</jsm>( 051 * <jsm>li</jsm>(<js>"Fast performance"</js>), 052 * <jsm>li</jsm>(<js>"Easy to use"</js>), 053 * <jsm>li</jsm>(<js>"24/7 support"</js>) 054 * ).class_(<js>"feature-list"</js>); 055 * 056 * <jc>// List with styling</jc> 057 * Ul <jv>styled</jv> = <jsm>ul</jsm>( 058 * <jsm>li</jsm>(<js>"Styled item 1"</js>), 059 * <jsm>li</jsm>(<js>"Styled item 2"</js>) 060 * ).class_(<js>"custom-list"</js>).style(<js>"list-style-type: square;"</js>); 061 * 062 * <jc>// Nested list</jc> 063 * Ul <jv>nested</jv> = <jsm>ul</jsm>( 064 * <jsm>li</jsm>(<js>"Main item 1"</js>), 065 * <jsm>li</jsm>( 066 * <js>"Main item 2"</js>, 067 * <jsm>ul</jsm>( 068 * <jsm>li</jsm>(<js>"Sub item 1"</js>), 069 * <jsm>li</jsm>(<js>"Sub item 2"</js>) 070 * ) 071 * ) 072 * ); 073 * 074 * <jc>// List with complex content</jc> 075 * Ul <jv>complex</jv> = <jsm>ul</jsm>( 076 * <jsm>li</jsm>( 077 * <jsm>strong</jsm>(<js>"Important"</js>), 078 * <js>" item with "</js>, 079 * <jsm>em</jsm>(<js>"emphasis"</js>) 080 * ), 081 * <jsm>li</jsm>(<js>"Simple item"</js>) 082 * ); 083 * </p> 084 * 085 * <p> 086 * The following convenience methods are provided for constructing instances of this bean: 087 * <ul class='javatree'> 088 * <li class='jc'>{@link HtmlBuilder} 089 * <ul class='javatree'> 090 * <li class='jm'>{@link HtmlBuilder#ul() ul()} 091 * <li class='jm'>{@link HtmlBuilder#ul(Object...) ul(Object...)} 092 * </ul> 093 * </ul> 094 * </p> 095 * 096 * <h5 class='section'>See Also:</h5><ul> 097 * <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/JuneauBeanHtml5">juneau-bean-html5</a> 098 * </ul> 099 */ 100@Marshalled(typeName = "ul") 101public class Ul extends HtmlElementContainer<Ul> { 102 103 /** 104 * Creates an empty {@link Ul} element. 105 */ 106 public Ul() {} 107 108 /** 109 * Creates a {@link Ul} element with the specified child nodes. 110 * 111 * @param children The child nodes. Must not be <jk>null</jk>. 112 */ 113 public Ul(Object...children) { 114 children(children); 115 } 116 117}