Package org.apache.poi.xslf.usermodel
Class XSLFTextParagraph
java.lang.Object
org.apache.poi.xslf.usermodel.XSLFTextParagraph
- All Implemented Interfaces:
Iterable<XSLFTextRun>,TextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
@Beta
public class XSLFTextParagraph
extends Object
implements TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
Represents a paragraph of text within the containing text body.
The paragraph is the highest level text separation mechanism.
- Since:
- -3.8
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.poi.sl.usermodel.TextParagraph
TextParagraph.BulletStyle, TextParagraph.FontAlign, TextParagraph.TextAlign -
Method Summary
Modifier and TypeMethodDescriptionInsert a line breakAdd a new run of textvoidaddTabStop(double value) voidaddTabStops(double positionInPoints, TabStop.TabStopType tabStopType) voidReturns the bullet size that is to be used within a paragraph.org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphPropertiesintdoublegetTabStop(int idx) getText()org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphbooleanisBullet()Returns whether this paragraph has bulletsbooleaniterator()protected XSLFTextRunHelper method to allow subclasses to provide their own text runprotected XSLFTextRunnewTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak r) booleanremoveTextRun(XSLFTextRun textRun) Remove a text runvoidsetBullet(boolean flag) voidsetBulletAutoNumber(AutoNumberingScheme scheme, int startAt) Specifies that automatic numbered bullet points should be applied to this paragraphvoidsetBulletCharacter(String str) voidsetBulletFont(String typeface) voidsetBulletFontColor(Color color) voidsetBulletFontColor(PaintStyle color) Set the color to be used on bullet characters within a given paragraph.voidsetBulletFontSize(double bulletSize) Sets the bullet size that is to be used within a paragraph.voidsetBulletStyle(Object... styles) voidSpecifies the font alignment that is to be applied to the paragraph.voidvoidsetIndentLevel(int level) voidsetLeftMargin(Double leftMargin) voidsetLineSpacing(Double lineSpacing) voidsetRightMargin(Double rightMargin) voidsetSpaceAfter(Double spaceAfter) voidsetSpaceBefore(Double spaceBefore) voidtoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getText
-
getXmlObject
-
getParentShape
- Specified by:
getParentShapein interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getTextRuns
- Specified by:
getTextRunsin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
iterator
- Specified by:
iteratorin interfaceIterable<XSLFTextRun>
-
addNewTextRun
Add a new run of text- Returns:
- a new run of text
-
removeTextRun
Remove a text run- Parameters:
textRun- a run of text- Returns:
- whether the run was removed
- Since:
- 5.2.2
-
addLineBreak
Insert a line break- Returns:
- text run representing this line break ('\n')
-
getTextAlign
- Specified by:
getTextAlignin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
setTextAlign
- Specified by:
setTextAlignin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getFontAlign
- Specified by:
getFontAlignin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
setFontAlign
Specifies the font alignment that is to be applied to the paragraph. Possible values for this include auto, top, center, baseline and bottom. seeTextParagraph.FontAlign.- Parameters:
align- font align
-
getBulletFont
- Returns:
- the font to be used on bullet characters within a given paragraph
-
setBulletFont
-
getBulletCharacter
- Returns:
- the character to be used in place of the standard bullet point
-
setBulletCharacter
-
getBulletFontColor
- Returns:
- the color of bullet characters within a given paragraph.
A
nullvalue means to use the text font color.
-
setBulletFontColor
-
setBulletFontColor
Set the color to be used on bullet characters within a given paragraph.- Parameters:
color- the bullet color
-
getBulletFontSize
Returns the bullet size that is to be used within a paragraph. This may be specified in two different ways, percentage spacing and font point spacing:If bulletSize >= 0, then bulletSize is a percentage of the font size. If bulletSize < 0, then it specifies the size in points
- Returns:
- the bullet size
-
setBulletFontSize
public void setBulletFontSize(double bulletSize) Sets the bullet size that is to be used within a paragraph. This may be specified in two different ways, percentage spacing and font point spacing:If bulletSize >= 0, then bulletSize is a percentage of the font size. If bulletSize < 0, then it specifies the size in points
-
getAutoNumberingScheme
- Returns:
- the auto numbering scheme, or null if not defined
-
getAutoNumberingStartAt
- Returns:
- the auto numbering starting number, or null if not defined
-
setIndent
- Specified by:
setIndentin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getIndent
- Specified by:
getIndentin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
setLeftMargin
- Specified by:
setLeftMarginin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getLeftMargin
- Specified by:
getLeftMarginin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun> - Returns:
- the left margin (in points) of the paragraph, null if unset
-
setRightMargin
- Specified by:
setRightMarginin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getRightMargin
- Specified by:
getRightMarginin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun> - Returns:
- the right margin of the paragraph, null if unset
-
getDefaultTabSize
- Specified by:
getDefaultTabSizein interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getTabStop
public double getTabStop(int idx) -
addTabStop
public void addTabStop(double value) -
setLineSpacing
- Specified by:
setLineSpacingin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getLineSpacing
- Specified by:
getLineSpacingin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
setSpaceBefore
- Specified by:
setSpaceBeforein interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getSpaceBefore
- Specified by:
getSpaceBeforein interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
setSpaceAfter
- Specified by:
setSpaceAfterin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getSpaceAfter
- Specified by:
getSpaceAfterin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
setIndentLevel
public void setIndentLevel(int level) - Specified by:
setIndentLevelin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getIndentLevel
public int getIndentLevel()- Specified by:
getIndentLevelin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
isBullet
public boolean isBullet()Returns whether this paragraph has bullets -
setBullet
public void setBullet(boolean flag) - Parameters:
flag- whether text in this paragraph has bullets
-
setBulletAutoNumber
Specifies that automatic numbered bullet points should be applied to this paragraph- Parameters:
scheme- type of auto-numberingstartAt- the number that will start number for a given sequence of automatically numbered bullets (1-based).
-
toString
-
getDefaultMasterStyle
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraphProperties getDefaultMasterStyle()- Returns:
- master style text paragraph properties, or
nullif there are no master slides or the master slides do not contain a text paragraph
-
getDefaultFontSize
- Specified by:
getDefaultFontSizein interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getDefaultFontFamily
- Specified by:
getDefaultFontFamilyin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getBulletStyle
- Specified by:
getBulletStylein interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
setBulletStyle
- Specified by:
setBulletStylein interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
getTabStops
- Specified by:
getTabStopsin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
addTabStops
- Specified by:
addTabStopsin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
clearTabStops
public void clearTabStops()- Specified by:
clearTabStopsin interfaceTextParagraph<XSLFShape,XSLFTextParagraph, XSLFTextRun>
-
newTextRun
Helper method to allow subclasses to provide their own text run- Parameters:
r- the xml reference- Returns:
- a new text paragraph
- Since:
- 3.15-beta2
-
newTextRun
-