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 protectedXDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTRegularTextRun run, XDDFTextParagraph parent)protectedXDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextField run, XDDFTextParagraph parent)protectedXDDFTextRun(org.openxmlformats.schemas.drawingml.x2006.main.CTTextLineBreak run, XDDFTextParagraph parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XDDFHyperlinkcreateMouseOver(java.lang.String action)java.util.LocalegetAlternativeLanguage()java.lang.StringgetBookmark()CapsTypegetCapitals()java.lang.DoublegetCharacterKerning()java.lang.DoublegetCharacterSpacing()java.lang.BooleangetDirty()XDDFColorgetFontColor()XDDFFont[]getFonts()java.lang.DoublegetFontSize()XDDFColorgetHighlight()XDDFHyperlinkgetHyperlink()java.util.LocalegetLanguage()XDDFLinePropertiesgetLineProperties()XDDFHyperlinkgetMouseOver()java.lang.BooleangetNoProof()java.lang.BooleangetNormalizeHeights()XDDFTextParagraphgetParentParagraph()protected org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterPropertiesgetProperties()java.lang.BooleangetSpellError()StrikeTypegetStrikeThrough()java.lang.StringgetText()UnderlineTypegetUnderline()booleanisBold()booleanisCapitals()booleanisField()booleanisItalic()booleanisKumimoji()booleanisLineBreak()booleanisRegularRun()booleanisStrikeThrough()booleanisSubscript()booleanisSuperscript()booleanisUnderline()XDDFHyperlinklinkToAction(java.lang.String action)XDDFHyperlinklinkToExternal(java.lang.String url, PackagePart localPart, POIXMLRelation relation)XDDFHyperlinklinkToInternal(java.lang.String action, PackagePart localPart, POIXMLRelation relation, PackagePartName target)voidsetAlternativeLanguage(java.util.Locale lang)voidsetBaseline(java.lang.Double offset)Set the baseline for both the superscript and subscript fonts.voidsetBold(java.lang.Boolean bold)Specifies whether this run of text will be formatted as bold text.voidsetBookmark(java.lang.String bookmark)voidsetCapitals(CapsType caps)voidsetCharacterKerning(java.lang.Double kerning)Set the kerning of characters within a text run.voidsetCharacterSpacing(java.lang.Double spacing)Set the spacing between characters within a text run.voidsetDirty(java.lang.Boolean dirty)voidsetFillProperties(XDDFFillProperties properties)voidsetFontColor(XDDFColor color)voidsetFonts(XDDFFont[] fonts)Note: In order to get fonts to unset the property for a given font family useXDDFFont.unsetFontForGroup(FontGroup)voidsetFontSize(java.lang.Double size)voidsetHighlight(XDDFColor color)voidsetItalic(java.lang.Boolean italic)voidsetKumimoji(java.lang.Boolean kumimoji)voidsetLanguage(java.util.Locale lang)voidsetLineProperties(XDDFLineProperties properties)voidsetNoProof(java.lang.Boolean noproof)voidsetNormalizeHeights(java.lang.Boolean normalize)voidsetSpellError(java.lang.Boolean error)voidsetStrikeThrough(StrikeType strike)voidsetSubscript(java.lang.Double offset)Set whether the text in this run is formatted as subscript.voidsetSuperscript(java.lang.Double offset)Set whether the text in this run is formatted as superscript.voidsetText(java.lang.String text)voidsetUnderline(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 valuenullunsets 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
nullunsets 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
nullunsets 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()
-
-