@Beta public class XSLFTextParagraph extends java.lang.Object implements TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
TextParagraph.BulletStyle, TextParagraph.FontAlign, TextParagraph.TextAlign
Modifier and Type | Method and Description |
---|---|
XSLFTextRun |
addLineBreak()
Insert a line break
|
XSLFTextRun |
addNewTextRun()
Add a new run of text
|
void |
addTabStop(double value) |
void |
addTabStops(double positionInPoints,
TabStop.TabStopType tabStopType)
Set the
TabStop collection |
void |
clearTabStops()
Removes the tabstops of this paragraphs.
|
AutoNumberingScheme |
getAutoNumberingScheme() |
java.lang.Integer |
getAutoNumberingStartAt() |
java.lang.String |
getBulletCharacter() |
java.lang.String |
getBulletFont() |
PaintStyle |
getBulletFontColor() |
java.lang.Double |
getBulletFontSize()
Returns the bullet size that is to be used within a paragraph.
|
TextParagraph.BulletStyle |
getBulletStyle() |
java.lang.String |
getDefaultFontFamily() |
java.lang.Double |
getDefaultFontSize() |
java.lang.Double |
getDefaultTabSize() |
TextParagraph.FontAlign |
getFontAlign()
Returns the font alignment that is applied to the paragraph.
|
java.lang.Double |
getIndent() |
int |
getIndentLevel() |
java.lang.Double |
getLeftMargin() |
java.lang.Double |
getLineSpacing()
Returns the vertical line spacing that is to be used within a paragraph.
|
XSLFTextShape |
getParentShape() |
java.lang.Double |
getRightMargin()
Specifies the right margin of the paragraph.
|
java.lang.Double |
getSpaceAfter()
The amount of vertical white space after the paragraph
This may be specified in two different ways, percentage spacing and font point spacing:
|
java.lang.Double |
getSpaceBefore()
The amount of vertical white space before the paragraph
This may be specified in two different ways, percentage spacing and font point spacing:
|
double |
getTabStop(int idx) |
java.util.List<XSLFTabStop> |
getTabStops()
Get the
TabStops - the list can't be and it's entries shouldn't be modified. |
java.lang.String |
getText() |
TextParagraph.TextAlign |
getTextAlign()
Returns the alignment that is applied to the paragraph.
|
java.util.List<XSLFTextRun> |
getTextRuns()
Fetch the text runs that are contained within this block of text
|
org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph |
getXmlObject() |
boolean |
isBullet()
Returns whether this paragraph has bullets
|
boolean |
isHeaderOrFooter()
Convenience method to determine if this text paragraph is part of
the slide header or footer
|
java.util.Iterator<XSLFTextRun> |
iterator() |
protected XSLFTextRun |
newTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak r) |
protected XSLFTextRun |
newTextRun(org.apache.xmlbeans.XmlObject r)
Helper method to allow subclasses to provide their own text run
|
void |
setBullet(boolean flag) |
void |
setBulletAutoNumber(AutoNumberingScheme scheme,
int startAt)
Specifies that automatic numbered bullet points should be applied to this paragraph
|
void |
setBulletCharacter(java.lang.String str) |
void |
setBulletFont(java.lang.String typeface) |
void |
setBulletFontColor(java.awt.Color color) |
void |
setBulletFontColor(PaintStyle color)
Set the color to be used on bullet characters within a given paragraph.
|
void |
setBulletFontSize(double bulletSize)
Sets the bullet size that is to be used within a paragraph.
|
void |
setBulletStyle(java.lang.Object... styles)
Sets the bullet styles.
|
void |
setFontAlign(TextParagraph.FontAlign align)
Specifies the font alignment that is to be applied to the paragraph.
|
void |
setIndent(java.lang.Double indent)
Specifies the indent size that will be applied to the first line of text in the paragraph.
|
void |
setIndentLevel(int level)
Specifies the particular level text properties that this paragraph will follow.
|
void |
setLeftMargin(java.lang.Double leftMargin)
Specifies the left margin of the paragraph.
|
void |
setLineSpacing(java.lang.Double lineSpacing)
This element specifies the vertical line spacing that is to be used within a paragraph.
|
void |
setRightMargin(java.lang.Double rightMargin) |
void |
setSpaceAfter(java.lang.Double spaceAfter)
Set the amount of vertical white space that will be present after the paragraph.
|
void |
setSpaceBefore(java.lang.Double spaceBefore)
Set the amount of vertical white space that will be present before the paragraph.
|
void |
setTextAlign(TextParagraph.TextAlign align)
Specifies the alignment that is to be applied to the paragraph.
|
java.lang.String |
toString() |
public java.lang.String getText()
@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTextParagraph getXmlObject()
public XSLFTextShape getParentShape()
getParentShape
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public java.util.List<XSLFTextRun> getTextRuns()
TextParagraph
getTextRuns
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public java.util.Iterator<XSLFTextRun> iterator()
iterator
in interface java.lang.Iterable<XSLFTextRun>
public XSLFTextRun addNewTextRun()
public XSLFTextRun addLineBreak()
public TextParagraph.TextAlign getTextAlign()
TextParagraph
TextParagraph.TextAlign.LEFT
then.getTextAlign
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void setTextAlign(TextParagraph.TextAlign align)
TextParagraph
TextParagraph.TextAlign
.setTextAlign
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
align
- text alignpublic TextParagraph.FontAlign getFontAlign()
TextParagraph
TextParagraph.FontAlign.AUTO
getFontAlign
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void setFontAlign(TextParagraph.FontAlign align)
TextParagraph.FontAlign
.align
- font alignpublic java.lang.String getBulletFont()
public void setBulletFont(java.lang.String typeface)
public java.lang.String getBulletCharacter()
public void setBulletCharacter(java.lang.String str)
public PaintStyle getBulletFontColor()
null
value means to use the text font color.public void setBulletFontColor(java.awt.Color color)
public void setBulletFontColor(PaintStyle color)
color
- the bullet colorpublic java.lang.Double getBulletFontSize()
If bulletSize >= 0, then bulletSize is a percentage of the font size. If bulletSize < 0, then it specifies the size in points
public void setBulletFontSize(double bulletSize)
If bulletSize >= 0, then bulletSize is a percentage of the font size. If bulletSize < 0, then it specifies the size in points
public AutoNumberingScheme getAutoNumberingScheme()
public java.lang.Integer getAutoNumberingStartAt()
public void setIndent(java.lang.Double indent)
TextParagraph
setIndent
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
indent
- the indent (in points) applied to the first line of text in the paragraphpublic java.lang.Double getIndent()
getIndent
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void setLeftMargin(java.lang.Double leftMargin)
TextParagraph
setLeftMargin
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
leftMargin
- the left margin (in points) or null to unsetpublic java.lang.Double getLeftMargin()
getLeftMargin
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void setRightMargin(java.lang.Double rightMargin)
setRightMargin
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
rightMargin
- the right margin (in points) of the paragraphpublic java.lang.Double getRightMargin()
TextParagraph
getRightMargin
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public java.lang.Double getDefaultTabSize()
getDefaultTabSize
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public double getTabStop(int idx)
public void addTabStop(double value)
public void setLineSpacing(java.lang.Double lineSpacing)
TextParagraph
If linespacing >= 0, then linespacing is a percentage of normal line height If linespacing < 0, the absolute value of linespacing is the spacing in points
Examples:
// spacing will be 120% of the size of the largest text on each line
paragraph.setLineSpacing(120);
// spacing will be 200% of the size of the largest text on each line
paragraph.setLineSpacing(200);
// spacing will be 48 points
paragraph.setLineSpacing(-48.0);
setLineSpacing
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
lineSpacing
- the vertical line spacingpublic java.lang.Double getLineSpacing()
TextParagraph
If linespacing >= 0, then linespacing is a percentage of normal line height. If linespacing < 0, the absolute value of linespacing is the spacing in points
getLineSpacing
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void setSpaceBefore(java.lang.Double spaceBefore)
TextParagraph
If spaceBefore >= 0, then space is a percentage of normal line height. If spaceBefore < 0, the absolute value of linespacing is the spacing in points
Examples:
// The paragraph will be formatted to have a spacing before the paragraph text.
// The spacing will be 200% of the size of the largest text on each line
paragraph.setSpaceBefore(200);
// The spacing will be a size of 48 points
paragraph.setSpaceBefore(-48.0);
setSpaceBefore
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
spaceBefore
- the vertical white space before the paragraph, null to unsetpublic java.lang.Double getSpaceBefore()
TextParagraph
If spaceBefore >= 0, then space is a percentage of normal line height. If spaceBefore < 0, the absolute value in points
getSpaceBefore
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void setSpaceAfter(java.lang.Double spaceAfter)
TextParagraph
If spaceAfter >= 0, then space is a percentage of normal line height. If spaceAfter < 0, the absolute value of linespacing is the spacing in points
Examples:
// The paragraph will be formatted to have a spacing after the paragraph text.
// The spacing will be 200% of the size of the largest text on each line
paragraph.setSpaceAfter(200);
// The spacing will be a size of 48 points
paragraph.setSpaceAfter(-48.0);
setSpaceAfter
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
spaceAfter
- the vertical white space after the paragraph, null to unsetpublic java.lang.Double getSpaceAfter()
TextParagraph
If spaceBefore >= 0, then space is a percentage of normal line height. If spaceBefore < 0, the absolute value of linespacing is the spacing in points
getSpaceAfter
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void setIndentLevel(int level)
TextParagraph
setIndentLevel
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
level
- the level (0 ... 4)public int getIndentLevel()
getIndentLevel
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public boolean isBullet()
public void setBullet(boolean flag)
flag
- whether text in this paragraph has bulletspublic void setBulletAutoNumber(AutoNumberingScheme scheme, int startAt)
scheme
- type of auto-numberingstartAt
- the number that will start number for a given sequence of automatically
numbered bullets (1-based).public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Double getDefaultFontSize()
getDefaultFontSize
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public java.lang.String getDefaultFontFamily()
getDefaultFontFamily
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public TextParagraph.BulletStyle getBulletStyle()
getBulletStyle
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
null
then no bullets are usedpublic void setBulletStyle(java.lang.Object... styles)
TextParagraph
setBulletStyle
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public java.util.List<XSLFTabStop> getTabStops()
TextParagraph
TabStops
- the list can't be and it's entries shouldn't be modified.
Opposed to other properties, this method is not cascading to the master sheet,
if the property is not defined on the normal slide level, i.e. the tabstops on
different levels aren't merged.getTabStops
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
null
if no tabstops are definedpublic void addTabStops(double positionInPoints, TabStop.TabStopType tabStopType)
TextParagraph
TabStop
collectionaddTabStops
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public void clearTabStops()
TextParagraph
clearTabStops
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
public boolean isHeaderOrFooter()
TextParagraph
isHeaderOrFooter
in interface TextParagraph<XSLFShape,XSLFTextParagraph,XSLFTextRun>
protected XSLFTextRun newTextRun(org.apache.xmlbeans.XmlObject r)
r
- the xml referenceprotected XSLFTextRun newTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak r)
Copyright 2020 The Apache Software Foundation or its licensors, as applicable.