Package com.itextpdf.layout.properties
Class ParagraphOrphansControl
- java.lang.Object
-
- com.itextpdf.layout.properties.ParagraphOrphansControl
-
public class ParagraphOrphansControl extends java.lang.Object
A specialized class holding configurable parameters related toParagraph
's orphans restrictions. This class is meant to be used as the value for theProperty.ORPHANS_CONTROL
key.
-
-
Field Summary
Fields Modifier and Type Field Description private int
minOrphans
-
Constructor Summary
Constructors Constructor Description ParagraphOrphansControl(int minOrphans)
Creates aParagraphOrphansControl
instance with a specified orphans limitation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getMinOrphans()
Gets minimal number of paragraph's lines to remain on an area before a split.void
handleViolatedOrphans(ParagraphRenderer renderer, java.lang.String message)
Writes a log message reporting that orphans constraint is violated.ParagraphOrphansControl
setMinAllowedOrphans(int minOrphans)
Sets parameter that defines orphans restrictions.
-
-
-
Constructor Detail
-
ParagraphOrphansControl
public ParagraphOrphansControl(int minOrphans)
Creates aParagraphOrphansControl
instance with a specified orphans limitation.- Parameters:
minOrphans
- minimal number of paragraph's lines to remain on an area before an area break.
-
-
Method Detail
-
setMinAllowedOrphans
public ParagraphOrphansControl setMinAllowedOrphans(int minOrphans)
Sets parameter that defines orphans restrictions.- Parameters:
minOrphans
- minimal number of paragraph's lines to remain on an area before an area break.- Returns:
- this
ParagraphOrphansControl
instance
-
getMinOrphans
public int getMinOrphans()
Gets minimal number of paragraph's lines to remain on an area before a split.- Returns:
- minimal number of paragraph's lines to remain on an area before an area break.
-
handleViolatedOrphans
public void handleViolatedOrphans(ParagraphRenderer renderer, java.lang.String message)
Writes a log message reporting that orphans constraint is violated. This method is to be overridden if violation scenarios need to be handled in some other way.- Parameters:
renderer
- a renderer processing orphansmessage
-String
explaining the reason for violation
-
-