Package com.itextpdf.tool.xml.html
Class ParaGraph
- java.lang.Object
-
- com.itextpdf.tool.xml.html.AbstractTagProcessor
-
- com.itextpdf.tool.xml.html.ParaGraph
-
- All Implemented Interfaces:
CssAppliersAware
,TagProcessor
public class ParaGraph extends AbstractTagProcessor
-
-
Constructor Summary
Constructors Constructor Description ParaGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addTabIntervalContent(WorkerContext ctx, Tag tag, java.util.List<Element> currentContent, Paragraph p, java.lang.String value)
Applies the tab interval of the p tag on itsTabbedChunk
elements.private void
addTabStopsContent(java.util.List<Element> currentContent, Paragraph p, java.lang.String value)
Applies the tab stops of the p tag on itsTabbedChunk
elements.java.util.List<Element>
content(WorkerContext ctx, Tag tag, java.lang.String content)
This method is called if there is text content encountered between the opening and closing tags this TagProcessor is mapped to.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)
.private Tag
getLastChild(Tag tag)
boolean
isStackOwner()
Defaults to false.protected void
processListItems(WorkerContext ctx, Tag tag, java.util.List<ListItem> listItems, java.util.List<Element> l)
protected void
processParagraphItems(WorkerContext ctx, Tag tag, java.util.List<Element> paragraphItems, java.util.List<Element> l)
-
Methods inherited from class com.itextpdf.tool.xml.html.AbstractTagProcessor
createParagraph, currentContentToParagraph, currentContentToParagraph, doRtlIndentCorrections, endElement, getCssAppliers, getCSSResolver, getHtmlPipelineContext, getRunDirection, invertTextAlignForParagraph, invertTextAlignForParagraph, setCssAppliers, start, startElement, textContent, updateParagraphFontIfNeeded
-
-
-
-
Method Detail
-
content
public java.util.List<Element> content(WorkerContext ctx, Tag tag, java.lang.String content)
Description copied from interface:TagProcessor
This method is called if there is text content encountered between the opening and closing tags this TagProcessor is mapped to.- Specified by:
content
in interfaceTagProcessor
- Overrides:
content
in classAbstractTagProcessor
- Parameters:
ctx
- the WorkerContexttag
- the tag encounteredcontent
- the text content between the tags this TagProcessor is mapped to.- Returns:
- the element to add to the currentContent list
-
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
-
processParagraphItems
protected void processParagraphItems(WorkerContext ctx, Tag tag, java.util.List<Element> paragraphItems, java.util.List<Element> l)
-
processListItems
protected void processListItems(WorkerContext ctx, Tag tag, java.util.List<ListItem> listItems, java.util.List<Element> l)
-
addTabIntervalContent
private void addTabIntervalContent(WorkerContext ctx, Tag tag, java.util.List<Element> currentContent, Paragraph p, java.lang.String value)
Applies the tab interval of the p tag on itsTabbedChunk
elements.
The style "xfa-tab-count" of theTabbedChunk
is multiplied with the tab interval of the p tag. This width is then added to a newTabbedChunk
. Elements other than TabbedChunks are added directly to the given Paragraph p.- Parameters:
currentContent
- containing the elements inside the p tag.p
- paragraph to which the tabbed chunks will be added.value
- the value of style "tab-interval".
-
addTabStopsContent
private void addTabStopsContent(java.util.List<Element> currentContent, Paragraph p, java.lang.String value)
Applies the tab stops of the p tag on itsTabbedChunk
elements.- Parameters:
currentContent
- containing the elements inside the p tag.p
- paragraph to which the tabbed chunks will be added.value
- the value of style "tab-stops".
-
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()
-
-