org.apache.poi.hssf.usermodel
Class HeaderFooter

java.lang.Object
  extended by org.apache.poi.hssf.usermodel.HeaderFooter
Direct Known Subclasses:
HSSFFooter, HSSFHeader

public abstract class HeaderFooter
extends java.lang.Object

Common class for HSSFHeader and HSSFFooter.


Nested Class Summary
static class HeaderFooter.Field
          Represents a special field in a header or footer, eg the page number
static class HeaderFooter.PairField
          A special field that normally comes in a pair, eg turn on underline / turn off underline
 
Field Summary
static HeaderFooter.PairField BOLD_FIELD
           
protected  java.lang.String center
           
static HeaderFooter.Field DATE_FIELD
           
static HeaderFooter.PairField DOUBLE_UNDERLINE_FIELD
           
static HeaderFooter.Field FILE_FIELD
           
static HeaderFooter.Field FULL_FILE_FIELD
           
static HeaderFooter.PairField ITALIC_FIELD
           
protected  java.lang.String left
           
static HeaderFooter.Field NUM_PAGES_FIELD
           
static HeaderFooter.Field PAGE_FIELD
           
static HeaderFooter.Field PICTURE_FIELD
           
protected  java.lang.String right
           
static HeaderFooter.Field SHEET_NAME_FIELD
           
static HeaderFooter.PairField STRIKETHROUGH_FIELD
           
static HeaderFooter.PairField SUBSCRIPT_FIELD
           
static HeaderFooter.PairField SUPERSCRIPT_FIELD
           
static HeaderFooter.Field TIME_FIELD
           
static HeaderFooter.PairField UNDERLINE_FIELD
           
 
Constructor Summary
protected HeaderFooter(java.lang.String text)
           
 
Method Summary
 boolean areFieldsStripped()
          Are fields currently being stripped from the text that this HeaderStories returns? Default is false, but can be changed
static java.lang.String date()
          Returns the string representing the current date
static java.lang.String endBold()
          Returns the string representing the end bold
static java.lang.String endDoubleUnderline()
          Returns the string representing the end double underline
static java.lang.String endUnderline()
          Returns the string representing the end underline
static java.lang.String file()
          Returns the string representing the current file name
static java.lang.String font(java.lang.String font, java.lang.String style)
          Returns the string that represents the change in font.
static java.lang.String fontSize(short size)
          Returns the string that represents the change in font size.
 java.lang.String getCenter()
          Get the center of the header or footer.
 java.lang.String getLeft()
          Get the left side of the header or footer.
 java.lang.String getRight()
          Get the right side of the header or footer.
static java.lang.String numPages()
          Returns the string representing the number of pages.
static java.lang.String page()
          Returns the string representing the current page number
 void setAreFieldsStripped(boolean stripFields)
          Should fields (eg macros) be stripped from the text that this class returns? Default is not to strip.
abstract  void setCenter(java.lang.String newCenter)
           
abstract  void setLeft(java.lang.String newLeft)
           
abstract  void setRight(java.lang.String newRight)
           
static java.lang.String startBold()
          Returns the string representing the start bold
static java.lang.String startDoubleUnderline()
          Returns the string representing the start double underline
static java.lang.String startUnderline()
          Returns the string representing the start underline
static java.lang.String stripFields(java.lang.String text)
          Removes any fields (eg macros, page markers etc) from the string.
static java.lang.String tab()
          Returns the string representing the current tab (sheet) name
static java.lang.String time()
          Returns the string representing the current time
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

left

protected java.lang.String left

center

protected java.lang.String center

right

protected java.lang.String right

SHEET_NAME_FIELD

public static final HeaderFooter.Field SHEET_NAME_FIELD

DATE_FIELD

public static final HeaderFooter.Field DATE_FIELD

FILE_FIELD

public static final HeaderFooter.Field FILE_FIELD

FULL_FILE_FIELD

public static final HeaderFooter.Field FULL_FILE_FIELD

PAGE_FIELD

public static final HeaderFooter.Field PAGE_FIELD

TIME_FIELD

public static final HeaderFooter.Field TIME_FIELD

NUM_PAGES_FIELD

public static final HeaderFooter.Field NUM_PAGES_FIELD

PICTURE_FIELD

public static final HeaderFooter.Field PICTURE_FIELD

BOLD_FIELD

public static final HeaderFooter.PairField BOLD_FIELD

ITALIC_FIELD

public static final HeaderFooter.PairField ITALIC_FIELD

STRIKETHROUGH_FIELD

public static final HeaderFooter.PairField STRIKETHROUGH_FIELD

SUBSCRIPT_FIELD

public static final HeaderFooter.PairField SUBSCRIPT_FIELD

SUPERSCRIPT_FIELD

public static final HeaderFooter.PairField SUPERSCRIPT_FIELD

UNDERLINE_FIELD

public static final HeaderFooter.PairField UNDERLINE_FIELD

DOUBLE_UNDERLINE_FIELD

public static final HeaderFooter.PairField DOUBLE_UNDERLINE_FIELD
Constructor Detail

HeaderFooter

protected HeaderFooter(java.lang.String text)
Method Detail

getLeft

public java.lang.String getLeft()
Get the left side of the header or footer.

Returns:
The string representing the left side.

setLeft

public abstract void setLeft(java.lang.String newLeft)

getCenter

public java.lang.String getCenter()
Get the center of the header or footer.

Returns:
The string representing the center.

setCenter

public abstract void setCenter(java.lang.String newCenter)

getRight

public java.lang.String getRight()
Get the right side of the header or footer.

Returns:
The string representing the right side.

setRight

public abstract void setRight(java.lang.String newRight)

fontSize

public static java.lang.String fontSize(short size)
Returns the string that represents the change in font size.

Parameters:
size - the new font size
Returns:
The special string to represent a new font size

font

public static java.lang.String font(java.lang.String font,
                                    java.lang.String style)
Returns the string that represents the change in font.

Parameters:
font - the new font
style - the fonts style, one of regular, italic, bold, italic bold or bold italic
Returns:
The special string to represent a new font size

page

public static java.lang.String page()
Returns the string representing the current page number

Returns:
The special string for page number

numPages

public static java.lang.String numPages()
Returns the string representing the number of pages.

Returns:
The special string for the number of pages

date

public static java.lang.String date()
Returns the string representing the current date

Returns:
The special string for the date

time

public static java.lang.String time()
Returns the string representing the current time

Returns:
The special string for the time

file

public static java.lang.String file()
Returns the string representing the current file name

Returns:
The special string for the file name

tab

public static java.lang.String tab()
Returns the string representing the current tab (sheet) name

Returns:
The special string for tab name

startBold

public static java.lang.String startBold()
Returns the string representing the start bold

Returns:
The special string for start bold

endBold

public static java.lang.String endBold()
Returns the string representing the end bold

Returns:
The special string for end bold

startUnderline

public static java.lang.String startUnderline()
Returns the string representing the start underline

Returns:
The special string for start underline

endUnderline

public static java.lang.String endUnderline()
Returns the string representing the end underline

Returns:
The special string for end underline

startDoubleUnderline

public static java.lang.String startDoubleUnderline()
Returns the string representing the start double underline

Returns:
The special string for start double underline

endDoubleUnderline

public static java.lang.String endDoubleUnderline()
Returns the string representing the end double underline

Returns:
The special string for end double underline

stripFields

public static java.lang.String stripFields(java.lang.String text)
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!


areFieldsStripped

public boolean areFieldsStripped()
Are fields currently being stripped from the text that this HeaderStories returns? Default is false, but can be changed


setAreFieldsStripped

public void setAreFieldsStripped(boolean stripFields)
Should fields (eg macros) be stripped from the text that this class returns? Default is not to strip.

Parameters:
stripFields -


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.