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
public class OrderedUnorderedList extends AbstractTagProcessor
-
-
Field Summary
Fields Modifier and Type Field Description private static FontSizeTranslator
fst
private static CssUtils
utils
-
Constructor Summary
Constructors Constructor Description OrderedUnorderedList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private float
calculateTopOrBottomSpacing(boolean isTop, boolean storeMarginBottom, Tag tag, Tag child, WorkerContext ctx)
Calculates top or bottom spacing of the list.java.util.List<Element>
end(WorkerContext ctx, Tag tag, java.util.List<Element> currentContent)
Classes extending AbstractTagProcessor should override this method for actions that should be done inTagProcessor.endElement(WorkerContext, Tag, List)
.boolean
isStackOwner()
Defaults to false.private java.util.List<Element>
populateList(java.util.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 Detail
-
fst
private static final FontSizeTranslator fst
-
utils
private static final CssUtils utils
-
-
Method Detail
-
end
public java.util.List<Element> end(WorkerContext ctx, Tag tag, java.util.List<Element> currentContent)
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
-
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:
TagProcessor.isStackOwner()
-
-