Package com.itextpdf.tool.xml.html
Class OrderedUnorderedList
java.lang.Object
com.itextpdf.tool.xml.html.AbstractTagProcessor
com.itextpdf.tool.xml.html.OrderedUnorderedList
- All Implemented Interfaces:
CssAppliersAware
,TagProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FontSizeTranslator
private static final CssUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate float
calculateTopOrBottomSpacing
(boolean isTop, boolean storeMarginBottom, Tag tag, Tag child, WorkerContext ctx) Calculates top or bottom spacing of the list.end
(WorkerContext ctx, Tag tag, List<Element> currentContent) Classes extending AbstractTagProcessor should override this method for actions that should be done inTagProcessor.endElement(WorkerContext, Tag, List)
.boolean
Defaults to false.populateList
(List<Element> currentContent) Fills a java.util.List with all elements found in currentContent.Methods inherited from class com.itextpdf.tool.xml.html.AbstractTagProcessor
content, createParagraph, currentContentToParagraph, currentContentToParagraph, doRtlIndentCorrections, endElement, getCssAppliers, getCSSResolver, getHtmlPipelineContext, getRunDirection, invertTextAlignForParagraph, invertTextAlignForParagraph, setCssAppliers, start, startElement, textContent, updateParagraphFontIfNeeded
-
Field Details
-
fst
-
utils
-
-
Constructor Details
-
OrderedUnorderedList
public OrderedUnorderedList()
-
-
Method Details
-
end
Description copied from class:AbstractTagProcessor
Classes extending AbstractTagProcessor should override this method for actions that should be done inTagProcessor.endElement(WorkerContext, Tag, List)
. TheAbstractTagProcessor.endElement(WorkerContext, Tag, List)
calls this method after or before doing certain stuff, (see it's description).- Overrides:
end
in classAbstractTagProcessor
- Parameters:
ctx
- the WorkerContexttag
- the tagcurrentContent
- the content created from e.g. inner tags, inner content and not yet added to document.- Returns:
- a List containing iText Element objects
-
populateList
-
calculateTopOrBottomSpacing
private float calculateTopOrBottomSpacing(boolean isTop, boolean storeMarginBottom, Tag tag, Tag child, WorkerContext ctx) Calculates top or bottom spacing of the list. In HTML following possibilities exist:- padding-top of the ul/ol tag == 0.
The margin-top values of the ul/ol tag and its first li tag are compared. The total spacing before is the largest margin value and the first li's padding-top. - padding-top of the ul/ol tag != 0.
The margin-top or bottom values of the ul/ol tag and its first li tag are accumulated, along with padding-top values of both tags. - padding-bottom of the ul/ol tag == 0.
The margin-bottom values of the ul/ol tag and its last li tag are compared. The total spacing after is the largest margin value and the first li's padding-bottom. - padding-bottom of the ul/ol tag != 0.
The margin-bottom or bottom values of the ul/ol tag and its last li tag are accumulated, along with padding-bottom values of both tags.
- Parameters:
isTop
- boolean, if true the top spacing is calculated, if false the bottom spacing is calculated.storeMarginBottom
- if true the calculated margin bottom value is stored for later comparison with the top margin value of the next tag.tag
- the ul/ol tag.child
- first or last li tag of this list.ctx
-- Returns:
- float containing the spacing before or after.
- padding-top of the ul/ol tag == 0.
-
isStackOwner
public boolean isStackOwner()Description copied from class:AbstractTagProcessor
Defaults to false.- Specified by:
isStackOwner
in interfaceTagProcessor
- Overrides:
isStackOwner
in classAbstractTagProcessor
- Returns:
- true if the tag implementation must keep it's own currentContent stack.
- See Also:
-