@Beta public class XSLFTextRun extends Object implements TextRun, HighlightColorSupport
TextRun.FieldType, TextRun.TextCap| Modifier | Constructor and Description |
|---|---|
protected |
XSLFTextRun(org.apache.xmlbeans.XmlObject r,
XSLFTextParagraph p) |
| Modifier and Type | Method and Description |
|---|---|
XSLFHyperlink |
createHyperlink() |
double |
getCharacterSpacing() |
TextRun.FieldType |
getFieldType() |
PaintStyle |
getFontColor() |
String |
getFontFamily() |
String |
getFontFamily(FontGroup fontGroup) |
FontInfo |
getFontInfo(FontGroup fontGroup) |
Double |
getFontSize() |
PaintStyle |
getHighlightColor()
Returns the font highlight (background) color for this text run.
|
XSLFHyperlink |
getHyperlink() |
XSLFTextParagraph |
getParagraph() |
byte |
getPitchAndFamily() |
String |
getRawText() |
org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties |
getRPr(boolean create)
Return the character properties
|
TextRun.TextCap |
getTextCap() |
org.apache.xmlbeans.XmlObject |
getXmlObject()
Return the text run xmlbeans object.
|
boolean |
isBold() |
boolean |
isItalic() |
boolean |
isStrikethrough() |
boolean |
isSubscript() |
boolean |
isSuperscript() |
boolean |
isUnderlined() |
void |
setBaselineOffset(double baselineOffset)
Set the baseline for both the superscript and subscript fonts.
|
void |
setBold(boolean bold) |
void |
setCharacterSpacing(double spc)
Set the spacing between characters within a text run.
|
void |
setFontColor(Color color) |
void |
setFontColor(PaintStyle color) |
void |
setFontFamily(String typeface) |
void |
setFontFamily(String typeface,
FontGroup fontGroup) |
void |
setFontInfo(FontInfo fontInfo,
FontGroup fontGroup) |
void |
setFontSize(Double fontSize) |
void |
setHighlightColor(Color color)
Sets the font highlight (background) color for this text run - convenience function
|
void |
setHighlightColor(PaintStyle color)
Set the highlight (background) color for this text run.
|
void |
setItalic(boolean italic) |
void |
setStrikethrough(boolean strike) |
void |
setSubscript(boolean flag)
Set whether the text in this run is formatted as subscript.
|
void |
setSuperscript(boolean flag)
Set whether the text in this run is formatted as superscript.
|
void |
setText(String text) |
void |
setUnderlined(boolean underline) |
String |
toString() |
protected XSLFTextRun(org.apache.xmlbeans.XmlObject r,
XSLFTextParagraph p)
public String getRawText()
getRawText in interface TextRun@Internal public org.apache.xmlbeans.XmlObject getXmlObject()
CTTextField,
CTTextLineBreak or usually a CTRegularTextRunpublic void setFontColor(Color color)
setFontColor in interface TextRunpublic void setFontColor(PaintStyle color)
setFontColor in interface TextRunpublic PaintStyle getFontColor()
getFontColor in interface TextRunpublic PaintStyle getHighlightColor()
PaintStyle.SolidPaint, or null if no highlight is set.getHighlightColor in interface HighlightColorSupportDrawPaint.getPaint(java.awt.Graphics2D, PaintStyle),
PaintStyle.SolidPaint.getSolidColor()public void setHighlightColor(Color color)
setHighlightColor in interface HighlightColorSupportcolor - The highlight (background) color to set.public void setHighlightColor(PaintStyle color)
setHighlightColor in interface HighlightColorSupportcolor - The highlight (background) color to set.IllegalArgumentException - If the supplied paint style is not null or a SolidPaint.DrawPaint.createSolidPaint(Color)public void setFontSize(Double fontSize)
setFontSize in interface TextRunpublic Double getFontSize()
getFontSize in interface TextRunpublic double getCharacterSpacing()
public void setCharacterSpacing(double spc)
The spacing is specified in points. Positive values will cause the text to expand, negative values to condense.
spc - character spacing in points.public void setFontFamily(String typeface)
setFontFamily in interface TextRunpublic void setFontFamily(String typeface, FontGroup fontGroup)
setFontFamily in interface TextRunpublic void setFontInfo(FontInfo fontInfo, FontGroup fontGroup)
setFontInfo in interface TextRunpublic String getFontFamily()
getFontFamily in interface TextRunpublic String getFontFamily(FontGroup fontGroup)
getFontFamily in interface TextRunpublic FontInfo getFontInfo(FontGroup fontGroup)
getFontInfo in interface TextRunpublic byte getPitchAndFamily()
getPitchAndFamily in interface TextRunpublic void setStrikethrough(boolean strike)
setStrikethrough in interface TextRunpublic boolean isStrikethrough()
isStrikethrough in interface TextRunpublic boolean isSuperscript()
isSuperscript in interface TextRunpublic void setBaselineOffset(double baselineOffset)
The size is specified using a percentage. Positive values indicate superscript, negative values indicate subscript.
public void setSuperscript(boolean flag)
setBaselineOffset(double)public void setSubscript(boolean flag)
setBaselineOffset(double)public boolean isSubscript()
isSubscript in interface TextRunpublic TextRun.TextCap getTextCap()
getTextCap in interface TextRunpublic void setUnderlined(boolean underline)
setUnderlined in interface TextRunpublic boolean isUnderlined()
isUnderlined in interface TextRun@Internal public org.openxmlformats.schemas.drawingml.x2006.main.CTTextCharacterProperties getRPr(boolean create)
create - if true, create an empty character properties object if it doesn't existpublic XSLFHyperlink createHyperlink()
createHyperlink in interface TextRunpublic XSLFHyperlink getHyperlink()
getHyperlink in interface TextRunpublic TextRun.FieldType getFieldType()
getFieldType in interface TextRunpublic XSLFTextParagraph getParagraph()
getParagraph in interface TextRun