public class Text extends Object implements ParagraphElement
The destination of embedded styles depends on the location of the text: * if the text is in a cell, the embedded styles will belong to content.xml/automatic-styles * if the text is in a footer/header, this footer/header style will belong to styles .xml/master-styles, and the embedded styles will go to styles.xml/automatic-styles.
| Modifier and Type | Field and Description |
|---|---|
static String |
TEXT_DATE
7.3.2 text:date "The text:date element displays a date, by default this is the current
date."
|
static String |
TEXT_FILE_NAME
7.3.9 text:file-name "The text:file-name element represents a field that displays the
name of a file that
is being edited."
|
static String |
TEXT_PAGE_COUNT
7.5.18.2 text:page-count
|
static String |
TEXT_PAGE_NUMBER
7.3.4 text:page-number "The text:page-number element displays the current page number."
|
static String |
TEXT_SHEET_NAME
7.3.11 text:sheet-name "The text:sheet-name element displays represents the name of a
sheet that is
currently being edited in a Spreadsheet document."
|
static String |
TEXT_TIME
7.3.3 text:time "The text:time element displays a time, by default this is the current
time."
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEmbeddedStylesFromCell(StylesContainer stylesContainer)
Add the styles to a container, in content.xml/automatic-styles
Use if the text is in a cell
|
void |
addEmbeddedStylesFromFooterHeader(StylesContainer stylesContainer)
Add the styles to a container, in styles.xml/automatic-styles
Use if the text is in a footer/header
|
void |
appendXMLContent(XMLUtil util,
Appendable appendable)
Write the XML format for this object.
|
static TextBuilder |
builder() |
static Text |
content(String text)
Create a simple Text object
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isEmpty() |
static Text |
styledContent(String text,
TextStyle ts)
Create a simple Text object with a style
|
public static final String TEXT_DATE
public static final String TEXT_FILE_NAME
public static final String TEXT_PAGE_COUNT
public static final String TEXT_PAGE_NUMBER
public static final String TEXT_SHEET_NAME
public static final String TEXT_TIME
public static TextBuilder builder()
public static Text content(String text)
text - the text contentpublic static Text styledContent(String text, TextStyle ts)
text - the text contentts - the stylepublic void addEmbeddedStylesFromCell(StylesContainer stylesContainer)
addEmbeddedStylesFromCell in interface ParagraphElementstylesContainer - the containerpublic void addEmbeddedStylesFromFooterHeader(StylesContainer stylesContainer)
addEmbeddedStylesFromFooterHeader in interface ParagraphElementstylesContainer - the containerpublic void appendXMLContent(XMLUtil util, Appendable appendable) throws IOException
XMLConvertibleappendXMLContent in interface XMLConvertibleutil - a helper objectappendable - the appendable to append data toIOException - if the style can't be addedpublic boolean isEmpty()
Copyright © 2016–2021. All rights reserved.