Package org.apache.poi.hssf.usermodel
Class HeaderFooter
java.lang.Object
org.apache.poi.hssf.usermodel.HeaderFooter
- All Implemented Interfaces:
HeaderFooter
- Direct Known Subclasses:
HSSFFooter
,HSSFHeader
Common class for
HSSFHeader
and HSSFFooter
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
date()
static String
endBold()
static String
static String
static String
file()
static String
static String
fontSize
(short size) final String
Get the center of the header or footer.final String
getLeft()
Get the left side of the header or footer.protected abstract String
final String
getRight()
Get the right side of the header or footer.static String
numPages()
static String
page()
final void
Sets the center string.protected abstract void
setHeaderFooterText
(String text) final void
Sets the left string.final void
Sets the right string or footer.static String
static String
static String
static String
stripFields
(String pText) Removes any fields (eg macros, page markers etc) from the string.static String
tab()
static String
time()
-
Constructor Details
-
HeaderFooter
protected HeaderFooter()
-
-
Method Details
-
getRawText
- Returns:
- the internal text representation (combining center, left and right parts).
Possibly empty string if no header or footer is set. Never
null
.
-
getLeft
Description copied from interface:HeaderFooter
Get the left side of the header or footer.- Specified by:
getLeft
in interfaceHeaderFooter
- Returns:
- the left side of the header or footer.
-
setLeft
Description copied from interface:HeaderFooter
Sets the left string.- Specified by:
setLeft
in interfaceHeaderFooter
- Parameters:
newLeft
- The string to set as the left side.
-
getCenter
Description copied from interface:HeaderFooter
Get the center of the header or footer.- Specified by:
getCenter
in interfaceHeaderFooter
- Returns:
- the center of the header or footer.
-
setCenter
Description copied from interface:HeaderFooter
Sets the center string.- Specified by:
setCenter
in interfaceHeaderFooter
- Parameters:
newCenter
- The string to set as the center.
-
getRight
Description copied from interface:HeaderFooter
Get the right side of the header or footer.- Specified by:
getRight
in interfaceHeaderFooter
- Returns:
- The right side of the header or footer.
-
setRight
Description copied from interface:HeaderFooter
Sets the right string or footer.- Specified by:
setRight
in interfaceHeaderFooter
- Parameters:
newRight
- The string to set as the right side.
-
fontSize
- Parameters:
size
- the new font size- Returns:
- The mark-up tag representing a new font size
-
font
- Parameters:
font
- the new fontstyle
- the fonts style, one of regular, italic, bold, italic bold or bold italic- Returns:
- The mark-up tag representing a new font size
-
page
- Returns:
- The mark-up tag representing the current page number
-
numPages
- Returns:
- The mark-up tag representing the number of pages
-
date
- Returns:
- The mark-up tag representing the current date date
-
time
- Returns:
- The mark-up tag representing current time
-
file
- Returns:
- The mark-up tag representing the current file name
-
tab
- Returns:
- The mark-up tag representing the current tab (sheet) name
-
startBold
- Returns:
- The mark-up tag for start bold
-
endBold
- Returns:
- The mark-up tag for end bold
-
startUnderline
- Returns:
- The mark-up tag for start underline
-
endUnderline
- Returns:
- The mark-up tag for end underline
-
startDoubleUnderline
- Returns:
- The mark-up tag for start double underline
-
endDoubleUnderline
- Returns:
- The mark-up tag for end double underline
-
stripFields
Removes any fields (eg macros, page markers etc) from the string. Normally used to make some text suitable for showing to humans, and the resultant text should not normally be saved back into the document!
-