Class XDDFTextRun
- java.lang.Object
-
- org.apache.poi.xddf.usermodel.text.XDDFTextRun
-
@Beta public class XDDFTextRun extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
XDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun run, XDDFTextParagraph parent)
protected
XDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextField run, XDDFTextParagraph parent)
protected
XDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak run, XDDFTextParagraph parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XDDFHyperlink
createMouseOver(java.lang.String action)
java.util.Locale
getAlternativeLanguage()
java.lang.String
getBookmark()
CapsType
getCapitals()
java.lang.Double
getCharacterKerning()
java.lang.Double
getCharacterSpacing()
java.lang.Boolean
getDirty()
XDDFColor
getFontColor()
XDDFFont[]
getFonts()
java.lang.Double
getFontSize()
XDDFColor
getHighlight()
XDDFHyperlink
getHyperlink()
java.util.Locale
getLanguage()
XDDFLineProperties
getLineProperties()
XDDFHyperlink
getMouseOver()
java.lang.Boolean
getNoProof()
java.lang.Boolean
getNormalizeHeights()
XDDFTextParagraph
getParentParagraph()
protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties
getProperties()
java.lang.Boolean
getSpellError()
StrikeType
getStrikeThrough()
java.lang.String
getText()
UnderlineType
getUnderline()
boolean
isBold()
boolean
isCapitals()
boolean
isField()
boolean
isItalic()
boolean
isKumimoji()
boolean
isLineBreak()
boolean
isRegularRun()
boolean
isStrikeThrough()
boolean
isSubscript()
boolean
isSuperscript()
boolean
isUnderline()
XDDFHyperlink
linkToAction(java.lang.String action)
XDDFHyperlink
linkToExternal(java.lang.String url, PackagePart localPart, POIXMLRelation relation)
XDDFHyperlink
linkToInternal(java.lang.String action, PackagePart localPart, POIXMLRelation relation, PackagePartName target)
void
setAlternativeLanguage(java.util.Locale lang)
void
setBaseline(java.lang.Double offset)
Set the baseline for both the superscript and subscript fonts.void
setBold(java.lang.Boolean bold)
Specifies whether this run of text will be formatted as bold text.void
setBookmark(java.lang.String bookmark)
void
setCapitals(CapsType caps)
void
setCharacterKerning(java.lang.Double kerning)
Set the kerning of characters within a text run.void
setCharacterSpacing(java.lang.Double spacing)
Set the spacing between characters within a text run.void
setDirty(java.lang.Boolean dirty)
void
setFillProperties(XDDFFillProperties properties)
void
setFontColor(XDDFColor color)
void
setFonts(XDDFFont[] fonts)
Note: In order to get fonts to unset the property for a given font family useXDDFFont.unsetFontForGroup(FontGroup)
void
setFontSize(java.lang.Double size)
void
setHighlight(XDDFColor color)
void
setItalic(java.lang.Boolean italic)
void
setKumimoji(java.lang.Boolean kumimoji)
void
setLanguage(java.util.Locale lang)
void
setLineProperties(XDDFLineProperties properties)
void
setNoProof(java.lang.Boolean noproof)
void
setNormalizeHeights(java.lang.Boolean normalize)
void
setSpellError(java.lang.Boolean error)
void
setStrikeThrough(StrikeType strike)
void
setSubscript(java.lang.Double offset)
Set whether the text in this run is formatted as subscript.void
setSuperscript(java.lang.Double offset)
Set whether the text in this run is formatted as superscript.void
setText(java.lang.String text)
void
setUnderline(UnderlineType underline)
-
-
-
Constructor Detail
-
XDDFTextRun
@Internal protected XDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak run, XDDFTextParagraph parent)
-
XDDFTextRun
@Internal protected XDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextField run, XDDFTextParagraph parent)
-
XDDFTextRun
@Internal protected XDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun run, XDDFTextParagraph parent)
-
-
Method Detail
-
getParentParagraph
public XDDFTextParagraph getParentParagraph()
-
isLineBreak
public boolean isLineBreak()
-
isField
public boolean isField()
-
isRegularRun
public boolean isRegularRun()
-
getText
public java.lang.String getText()
-
setText
public void setText(java.lang.String text)
-
setDirty
public void setDirty(java.lang.Boolean dirty)
-
getDirty
public java.lang.Boolean getDirty()
-
setSpellError
public void setSpellError(java.lang.Boolean error)
-
getSpellError
public java.lang.Boolean getSpellError()
-
setNoProof
public void setNoProof(java.lang.Boolean noproof)
-
getNoProof
public java.lang.Boolean getNoProof()
-
setNormalizeHeights
public void setNormalizeHeights(java.lang.Boolean normalize)
-
getNormalizeHeights
public java.lang.Boolean getNormalizeHeights()
-
setKumimoji
public void setKumimoji(java.lang.Boolean kumimoji)
-
isKumimoji
public boolean isKumimoji()
-
setBold
public void setBold(java.lang.Boolean bold)
Specifies whether this run of text will be formatted as bold text.- Parameters:
bold
- whether this run of text will be formatted as bold text.
-
isBold
public boolean isBold()
- Returns:
- whether this run of text is formatted as bold text.
-
setItalic
public void setItalic(java.lang.Boolean italic)
- Parameters:
italic
- whether this run of text is formatted as italic text.
-
isItalic
public boolean isItalic()
- Returns:
- whether this run of text is formatted as italic text.
-
setStrikeThrough
public void setStrikeThrough(StrikeType strike)
- Parameters:
strike
- which strike style this run of text is formatted with.
-
isStrikeThrough
public boolean isStrikeThrough()
- Returns:
- whether this run of text is formatted as striked text.
-
getStrikeThrough
public StrikeType getStrikeThrough()
- Returns:
- which strike style this run of text is formatted with.
-
setUnderline
public void setUnderline(UnderlineType underline)
- Parameters:
underline
- which underline style this run of text is formatted with.
-
isUnderline
public boolean isUnderline()
- Returns:
- whether this run of text is formatted as underlined text.
-
getUnderline
public UnderlineType getUnderline()
- Returns:
- which underline style this run of text is formatted with.
-
setCapitals
public void setCapitals(CapsType caps)
- Parameters:
caps
- which caps style this run of text is formatted with.
-
isCapitals
public boolean isCapitals()
- Returns:
- whether this run of text is formatted as capitalized text.
-
getCapitals
public CapsType getCapitals()
- Returns:
- which caps style this run of text is formatted with.
-
isSubscript
public boolean isSubscript()
- Returns:
- whether a run of text will be formatted as a subscript text. Default is false.
-
isSuperscript
public boolean isSuperscript()
- Returns:
- whether a run of text will be formatted as a superscript text. Default is false.
-
setBaseline
public void setBaseline(java.lang.Double offset)
Set the baseline for both the superscript and subscript fonts.The size is specified using a percentage. Positive values indicate superscript, negative values indicate subscript.
- Parameters:
offset
-
-
setSuperscript
public void setSuperscript(java.lang.Double offset)
Set whether the text in this run is formatted as superscript.The size is specified using a percentage.
- Parameters:
offset
-
-
setSubscript
public void setSubscript(java.lang.Double offset)
Set whether the text in this run is formatted as subscript.The size is specified using a percentage.
- Parameters:
offset
-
-
setFillProperties
public void setFillProperties(XDDFFillProperties properties)
-
setFontColor
public void setFontColor(XDDFColor color)
-
getFontColor
public XDDFColor getFontColor()
-
setFonts
public void setFonts(XDDFFont[] fonts)
Note: In order to get fonts to unset the property for a given font family useXDDFFont.unsetFontForGroup(FontGroup)
- Parameters:
fonts
- to set or unset on the run.
-
getFonts
public XDDFFont[] getFonts()
-
setFontSize
public void setFontSize(java.lang.Double size)
- Parameters:
size
- font size in points. The valuenull
unsets the size for this run.- Minimum inclusive =
- 1
- Maximum inclusive =
- 400
-
getFontSize
public java.lang.Double getFontSize()
-
setCharacterKerning
public void setCharacterKerning(java.lang.Double kerning)
Set the kerning of characters within a text run.The value
null
unsets the kerning for this run.- Parameters:
kerning
- character kerning in points.- Minimum inclusive =
- 0
- Maximum inclusive =
- 4000
-
getCharacterKerning
public java.lang.Double getCharacterKerning()
- Returns:
- the kerning of characters within a text run,
If this attribute is omitted then returns
null
.
-
setCharacterSpacing
public void setCharacterSpacing(java.lang.Double spacing)
Set the spacing between characters within a text run.The spacing is specified in points. Positive values will cause the text to expand, negative values to condense.
The value
null
unsets the spacing for this run.- Parameters:
spacing
- character spacing in points.- Minimum inclusive =
- -4000
- Maximum inclusive =
- 4000
-
getCharacterSpacing
public java.lang.Double getCharacterSpacing()
- Returns:
- the spacing between characters within a text run,
If this attribute is omitted then returns
null
.
-
setBookmark
public void setBookmark(java.lang.String bookmark)
-
getBookmark
public java.lang.String getBookmark()
-
linkToExternal
public XDDFHyperlink linkToExternal(java.lang.String url, PackagePart localPart, POIXMLRelation relation)
-
linkToAction
public XDDFHyperlink linkToAction(java.lang.String action)
-
linkToInternal
public XDDFHyperlink linkToInternal(java.lang.String action, PackagePart localPart, POIXMLRelation relation, PackagePartName target)
-
getHyperlink
public XDDFHyperlink getHyperlink()
-
createMouseOver
public XDDFHyperlink createMouseOver(java.lang.String action)
-
getMouseOver
public XDDFHyperlink getMouseOver()
-
setLanguage
public void setLanguage(java.util.Locale lang)
-
getLanguage
public java.util.Locale getLanguage()
-
setAlternativeLanguage
public void setAlternativeLanguage(java.util.Locale lang)
-
getAlternativeLanguage
public java.util.Locale getAlternativeLanguage()
-
setHighlight
public void setHighlight(XDDFColor color)
-
getHighlight
public XDDFColor getHighlight()
-
setLineProperties
public void setLineProperties(XDDFLineProperties properties)
-
getLineProperties
public XDDFLineProperties getLineProperties()
-
getProperties
@Internal protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties getProperties()
-
-