Class OrderedList<T extends OrderedList<T>>

All Implemented Interfaces:
com.oorian.css.ListIntf<T>

public class OrderedList<T extends OrderedList<T>> extends Ol<T>
Represents an HTML ordered list element, providing a semantic alias for Ol.

The OrderedList class is a convenience wrapper that extends Ol, providing a more descriptive class name for developers who prefer explicit naming. It offers identical functionality to the Ol class.

Features:

  • Identical functionality to Ol
  • More descriptive class name
  • Automatically numbered list items
  • Customizable marker types (1, A, a, I, i)
  • Configurable starting number and reversed ordering
  • Semantic representation of ordered content

Usage:


 // Same as using Ol, but with more explicit naming
 OrderedList instructions = new OrderedList();
 instructions.addItem("First step");
 instructions.addItem("Second step");
 instructions.addItem("Third step");

 // All Ol methods are available
 OrderedList chapters = new OrderedList();
 chapters.setType(OlMarkerType.UPPER_ROMAN);
 chapters.setStart(1);
 chapters.addItem("Introduction");
 chapters.addItem("Main Content");
 chapters.addItem("Conclusion");
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • OrderedList

      public OrderedList()
  • Method Details

    • setListStyle

      public T setListStyle(String attrValue)
      Sets the overall list-style CSS property.
      Specified by:
      setListStyle in interface com.oorian.css.ListIntf<T extends com.oorian.html.elements.List<T>>
      Parameters:
      attrValue - the list-style value
      Returns:
      this for method chaining
    • setListStyleImage

      public T setListStyleImage(String attrValue)
      Sets the list-style-image CSS property.
      Specified by:
      setListStyleImage in interface com.oorian.css.ListIntf<T extends com.oorian.html.elements.List<T>>
      Parameters:
      attrValue - the URL of the image to use as a list marker
      Returns:
      this for method chaining
    • setListStyleType

      public T setListStyleType(String attrValue)
      Sets the list-style-type CSS property.
      Specified by:
      setListStyleType in interface com.oorian.css.ListIntf<T extends com.oorian.html.elements.List<T>>
      Parameters:
      attrValue - the list-style-type value (e.g., "disc", "circle", "decimal")
      Returns:
      this for method chaining
    • setListStyleType

      public T setListStyleType(ListStyleType attrValue)
      Sets the list-style-type CSS property using a type-safe constant.
      Specified by:
      setListStyleType in interface com.oorian.css.ListIntf<T extends com.oorian.html.elements.List<T>>
      Parameters:
      attrValue - the ListStyleType constant
      Returns:
      this for method chaining
    • setListStylePosition

      public T setListStylePosition(String listStylePosition)
      Sets the list-style-position CSS property.
      Specified by:
      setListStylePosition in interface com.oorian.css.ListIntf<T extends com.oorian.html.elements.List<T>>
      Parameters:
      listStylePosition - the position value ("inside" or "outside")
      Returns:
      this for method chaining
    • setListStylePosition

      public T setListStylePosition(ListStylePosition attrValue)
      Sets the list-style-position CSS property using a type-safe constant.
      Specified by:
      setListStylePosition in interface com.oorian.css.ListIntf<T extends com.oorian.html.elements.List<T>>
      Parameters:
      attrValue - the ListStylePosition constant
      Returns:
      this for method chaining
    • addListItem

      public Li addListItem(Element element)
      Adds a list item containing the specified HTML element.
      Parameters:
      element - the HTML element to wrap in a list item
      Returns:
      the created Li element
    • addListItem

      public Li addListItem(String text)
      Adds a list item with the specified text content.
      Parameters:
      text - the text content for the list item
      Returns:
      the created Li element
    • addListItem

      public Li addListItem(Li item)
      Adds an existing list item to this list.
      Parameters:
      item - the Li element to add
      Returns:
      the added Li element
    • insertListItem

      public Li insertListItem(int index, Li item)
      Inserts a list item at the specified index.
      Parameters:
      index - the position to insert at (0-based)
      item - the Li element to insert
      Returns:
      the inserted Li element
    • insertListItem

      public Li insertListItem(int index, Element element)
      Inserts a list item containing an HTML element at the specified index.
      Parameters:
      index - the position to insert at (0-based)
      element - the HTML element to wrap in a list item
      Returns:
      the created Li element
    • insertListItem

      public Li insertListItem(int index, String text)
      Inserts a list item with text content at the specified index.
      Parameters:
      index - the position to insert at (0-based)
      text - the text content for the list item
      Returns:
      the created Li element
    • removeListItems

      public void removeListItems()
      Removes all list items from this list.
    • removeListItem

      public void removeListItem(Element element)
      Removes a specific list item from this list.
      Parameters:
      element - the list item element to remove