Class List

All Implemented Interfaces:
ContentLogger, Serializable

public class List extends Sequence

A content list is a numbered or unnumbered list of items. Each item itself can be a simple or a complex content.

Usage example:

 List list= new List(ListComment.ListType.UNNUMBERED);
 for (long val : actualSleepMillis) {
   list.addItem(new Paragraph(Inline.format(includeSpec, 
                      "start - %d ms - stop", val)));
 }
 

The result is rendered in HTML as follows:

  • start - 50 ms - stop

  • start - 60 ms - stop

  • start - 55 ms - stop

  • start - 50 ms - stop

  • start - 150 ms - stop

See Also:
  • Constructor Details

    • List

      public List(List.ListType listType)
      Create an empty list
      Parameters:
      listType - the render type.
  • Method Details

    • getListType

      public List.ListType getListType()
      Returns:
      the render type
    • toString

      public String toString(String prefix)
      Description copied from class: Content
      This method is for debugging purposes.
      Overrides:
      toString in class Content
      Parameters:
      prefix - If the output has multiple lines, prefix specifies the indentation of the subsequent lines.
      Returns:
      a string representation of the content and it's internal structure.
      See Also:
    • hashCode

      public int hashCode()
      implements the contract of Object.hashCode().
      Overrides:
      hashCode in class Sequence
      See Also:
    • equals

      public boolean equals(Object obj)
      implements the contract of Object.equals(Object).
      Overrides:
      equals in class Sequence
    • renderHtmlImpl

      public void renderHtmlImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx, boolean useJavascript)
      Description copied from class: Sequence
      appends all comments in the sequence one after the other without any visual marks between the individual items.
      Overrides:
      renderHtmlImpl in class Sequence
      Parameters:
      sb - HTML code result
      includeInfo - controls, which content to be rendered.
      ctx - render context
      useJavascript - if true, the generated HTML code will contain Javascript
      See Also:
      • de.hsh.graja.util.comment.Content#renderHtml(StringBuilder, IncludeInfo, RenderContext)
    • renderPlainImpl

      public void renderPlainImpl(StringBuilder appender, IncludeInfo includeInfo, RenderContext ctx)
      Description copied from class: Sequence
      appends all comments in the sequence one after the other without any visual marks between the individual items.
      Overrides:
      renderPlainImpl in class Sequence
      Parameters:
      appender - plain text result
      includeInfo - controls, which content to be rendered.
      ctx - render context (unused).
      See Also: