Package de.hsh.graja.util.comment
Class List
- java.lang.Object
-
- de.hsh.graja.util.comment.Content
-
- de.hsh.graja.util.comment.AbstractSequenceContent
-
- de.hsh.graja.util.comment.Sequence
-
- de.hsh.graja.util.comment.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
List.ListType
This enum specifies, whether the list is rendered with or without leading numbers.
-
Field Summary
-
Fields inherited from class de.hsh.graja.util.comment.Content
EXCLUSIVE, renderUuid
-
-
Constructor Summary
Constructors Constructor Description List(List.ListType listType)
Create an empty list
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
implements the contract ofObject.equals(Object)
.List.ListType
getListType()
int
hashCode()
implements the contract ofObject.hashCode()
.void
renderHtmlImpl(StringBuilder sb, IncludeInfo includeInfo, RenderContext ctx, boolean useJavascript)
appends all comments in the sequence one after the other without any visual marks between the individual items.void
renderPlainImpl(StringBuilder appender, IncludeInfo includeInfo, RenderContext ctx)
appends all comments in the sequence one after the other without any visual marks between the individual items.String
toString(String prefix)
This method is for debugging purposes.-
Methods inherited from class de.hsh.graja.util.comment.Sequence
addItem, addItems, clear, formatAsInlineNewlineSeq, getNestedContents, size
-
Methods inherited from class de.hsh.graja.util.comment.Content
click, disableCallerStacktraceRecording, enableCallerStacktraceRecording, excludeGlobally, getIncludeSpec, getRenderUuid, getStackdump, hide, include, isCallerStacktraceRecordingEnabled, isHidden, isShowing, onClick, onClick, onHide, onHide, onLoad, onLoad, onShow, onShow, registerCallable, renderHtml, renderHtml, renderIdAttribute, renderJavascriptOncePerClass, renderOnClickAttribute, renderPlain, renderPlain, setGlobalIncludeInfo, setHref, setIncludeSpec, show, toString
-
-
-
-
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 classContent
- 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)
-
hashCode
public int hashCode()
implements the contract ofObject.hashCode()
.- Overrides:
hashCode
in classSequence
- See Also:
Object.hashCode()
-
equals
public boolean equals(Object obj)
implements the contract ofObject.equals(Object)
.
-
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 classSequence
- Parameters:
sb
- HTML code resultincludeInfo
- controls, which content to be rendered.ctx
- render contextuseJavascript
- 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 classSequence
- Parameters:
appender
- plain text resultincludeInfo
- controls, which content to be rendered.ctx
- render context (unused).- See Also:
Content.renderPlainImpl(StringBuilder, IncludeInfo, RenderContext)
-
-