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:
    Serialized Form
    • Constructor Detail

      • List

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

      • 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:
        Content.toString(java.lang.String)
      • 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)