com.lowagie.text.rtf.parser.properties

Class RtfProperty

public class RtfProperty extends Object

RtfProperty handles document, paragraph, etc. property values

Since: 2.0.8

Author: Howard Shank (hgshank@yahoo.com)

Field Summary
static StringCHARACTER
static StringCHARACTER_BOLD
static StringCHARACTER_FONT
static StringCHARACTER_ITALIC
static StringCHARACTER_SIZE
static StringCHARACTER_STYLE
static StringCHARACTER_UNDERLINE
static StringCOLOR
static StringCOLOR_BG
static StringCOLOR_FG
static StringDOCUMENT
static StringDOCUMENT_DEFAULT_FONT_NUMER
static StringDOCUMENT_ENABLE_FACING_PAGES
static StringDOCUMENT_MARGIN_BOTTOM_TWIPS
static StringDOCUMENT_MARGIN_LEFT_TWIPS
static StringDOCUMENT_MARGIN_RIGHT_TWIPS
static StringDOCUMENT_MARGIN_TOP_TWIPS
static StringDOCUMENT_PAGE_HEIGHT_TWIPS
static StringDOCUMENT_PAGE_NUMBER_START
static StringDOCUMENT_PAGE_ORIENTATION
static StringDOCUMENT_PAGE_WIDTH_TWIPS
static intJUSTIFY_CENTER
Justify center
static intJUSTIFY_FULL
Justify full
static intJUSTIFY_LEFT
Justify left
static intJUSTIFY_RIGHT
Justify right
ArrayListlisteners
The RtfPropertyListener.
booleanmodifiedCharacter
booleanmodifiedDocument
booleanmodifiedParagraph
booleanmodifiedSection
static intOFF
static intON
protected HashMapproperties
Properties for this RtfProperty object
static StringPAGE_LANDSCAPE
Landscape orientation
static StringPAGE_PORTRAIT
Portrait orientation
static StringPARAGRAPH
static StringPARAGRAPH_BORDER
static intPARAGRAPH_BORDER_BOTTOM
possible border settting
static StringPARAGRAPH_BORDER_CELL
static intPARAGRAPH_BORDER_DIAGONAL_UL_LR
possible border settting
static intPARAGRAPH_BORDER_DIAGONAL_UR_LL
possible border settting
static intPARAGRAPH_BORDER_LEFT
possible border settting
static intPARAGRAPH_BORDER_NIL
possible border settting
static intPARAGRAPH_BORDER_RIGHT
possible border settting
static intPARAGRAPH_BORDER_TABLE_HORIZONTAL
possible border settting
static intPARAGRAPH_BORDER_TABLE_VERTICAL
possible border settting
static intPARAGRAPH_BORDER_TOP
possible border settting
static StringPARAGRAPH_INDENT_FIRST_LINE
static StringPARAGRAPH_INDENT_LEFT
static StringPARAGRAPH_INDENT_RIGHT
static StringPARAGRAPH_JUSTIFICATION
static intPGN_DECIMAL
Decimal number format
static intPGN_LETTER_LOWERCASE
Lowercase Letter
static intPGN_LETTER_UPPERCASE
Uppercase Letter
static intPGN_ROMAN_NUMERAL_LOWERCASE
Lowercase Roman Numeral
static intPGN_ROMAN_NUMERAL_UPPERCASE
Uppercase Roman Numeral
static intSBK_COLUMN
Section Break Column break
static intSBK_EVEN
Section Break Even page break
static intSBK_NONE
Section Break None
static intSBK_ODD
Section Break Odd page break
static intSBK_PAGE
Section Break Page break
static StringSECTION
static StringSECTION_BREAK_TYPE
static StringSECTION_NUMBER_OF_COLUMNS
static StringSECTION_PAGE_NUMBER_FORMAT
static StringSECTION_PAGE_NUMBER_POSITION_X
static StringSECTION_PAGE_NUMBER_POSITION_Y
Method Summary
voidaddRtfPropertyListener(RtfPropertyListener listener)
Adds a RtfPropertyListener to the RtfProperty.
booleanaddToProperty(String propertyName, int propertyValue)
Add the value of the property identified by the parameter.
booleanaddToProperty(String propertyName, long propertyValue)
Add the value of the property identified by the parameter.
voidafterChange(String propertyName)
voidbeforeChange(String propertyName)
HashMapgetProperties(String propertyGroup)
Get a group of properties.
ObjectgetProperty(String propertyName)
Get the value of the property identified by the parameter.
booleanisModified()
booleanisModifiedCharacter()
booleanisModifiedDocument()
booleanisModifiedParagraph()
booleanisModifiedSection()
booleanremoveProperty(String propertyName)
voidremoveRtfPropertyListener(RtfPropertyListener listener)
Removes a RtfPropertyListener from the RtfProperty.
voidsetModified(String propertyName, boolean modified)
voidsetModifiedCharacter(boolean modifiedCharacter)
voidsetModifiedDocument(boolean modifiedDocument)
voidsetModifiedParagraph(boolean modifiedParagraph)
voidsetModifiedSection(boolean modifiedSection)
booleansetProperty(RtfCtrlWordData ctrlWordData)
Set the value of the property identified by the parameter.
booleansetProperty(String propertyName, Object propertyValueNew)
Set the value of the property identified by the parameter.
booleansetProperty(String propertyName, int propertyValueNew)
Set the value of the property identified by the parameter.
booleansetProperty(String propertyName, long propertyValueNew)
Set the value of the property identified by the parameter.
voidsetToDefault()
Set all property objects to default values.
voidsetToDefault(String propertyGroup)
Set individual property group to default values.
booleantoggleProperty(RtfCtrlWordData ctrlWordData)
Toggle the value of the property identified by the RtfCtrlWordData.specialHandler parameter.

Field Detail

CHARACTER

public static final String CHARACTER

CHARACTER_BOLD

public static final String CHARACTER_BOLD

CHARACTER_FONT

public static final String CHARACTER_FONT

CHARACTER_ITALIC

public static final String CHARACTER_ITALIC

CHARACTER_SIZE

public static final String CHARACTER_SIZE

CHARACTER_STYLE

public static final String CHARACTER_STYLE

CHARACTER_UNDERLINE

public static final String CHARACTER_UNDERLINE

COLOR

public static final String COLOR

COLOR_BG

public static final String COLOR_BG

COLOR_FG

public static final String COLOR_FG

DOCUMENT

public static final String DOCUMENT

DOCUMENT_DEFAULT_FONT_NUMER

public static final String DOCUMENT_DEFAULT_FONT_NUMER

DOCUMENT_ENABLE_FACING_PAGES

public static final String DOCUMENT_ENABLE_FACING_PAGES

DOCUMENT_MARGIN_BOTTOM_TWIPS

public static final String DOCUMENT_MARGIN_BOTTOM_TWIPS

DOCUMENT_MARGIN_LEFT_TWIPS

public static final String DOCUMENT_MARGIN_LEFT_TWIPS

DOCUMENT_MARGIN_RIGHT_TWIPS

public static final String DOCUMENT_MARGIN_RIGHT_TWIPS

DOCUMENT_MARGIN_TOP_TWIPS

public static final String DOCUMENT_MARGIN_TOP_TWIPS

DOCUMENT_PAGE_HEIGHT_TWIPS

public static final String DOCUMENT_PAGE_HEIGHT_TWIPS

DOCUMENT_PAGE_NUMBER_START

public static final String DOCUMENT_PAGE_NUMBER_START

DOCUMENT_PAGE_ORIENTATION

public static final String DOCUMENT_PAGE_ORIENTATION

DOCUMENT_PAGE_WIDTH_TWIPS

public static final String DOCUMENT_PAGE_WIDTH_TWIPS

JUSTIFY_CENTER

public static final int JUSTIFY_CENTER
Justify center

JUSTIFY_FULL

public static final int JUSTIFY_FULL
Justify full

JUSTIFY_LEFT

public static final int JUSTIFY_LEFT
Justify left

JUSTIFY_RIGHT

public static final int JUSTIFY_RIGHT
Justify right

listeners

private ArrayList listeners
The RtfPropertyListener.

modifiedCharacter

private boolean modifiedCharacter

modifiedDocument

private boolean modifiedDocument

modifiedParagraph

private boolean modifiedParagraph

modifiedSection

private boolean modifiedSection

OFF

public static final int OFF

ON

public static final int ON

properties

protected HashMap properties
Properties for this RtfProperty object

PAGE_LANDSCAPE

public static final String PAGE_LANDSCAPE
Landscape orientation

PAGE_PORTRAIT

public static final String PAGE_PORTRAIT
Portrait orientation

PARAGRAPH

public static final String PARAGRAPH

PARAGRAPH_BORDER

public static final String PARAGRAPH_BORDER

PARAGRAPH_BORDER_BOTTOM

public static final int PARAGRAPH_BORDER_BOTTOM
possible border settting

PARAGRAPH_BORDER_CELL

public static final String PARAGRAPH_BORDER_CELL

PARAGRAPH_BORDER_DIAGONAL_UL_LR

public static final int PARAGRAPH_BORDER_DIAGONAL_UL_LR
possible border settting

PARAGRAPH_BORDER_DIAGONAL_UR_LL

public static final int PARAGRAPH_BORDER_DIAGONAL_UR_LL
possible border settting

PARAGRAPH_BORDER_LEFT

public static final int PARAGRAPH_BORDER_LEFT
possible border settting

PARAGRAPH_BORDER_NIL

public static final int PARAGRAPH_BORDER_NIL
possible border settting

PARAGRAPH_BORDER_RIGHT

public static final int PARAGRAPH_BORDER_RIGHT
possible border settting

PARAGRAPH_BORDER_TABLE_HORIZONTAL

public static final int PARAGRAPH_BORDER_TABLE_HORIZONTAL
possible border settting

PARAGRAPH_BORDER_TABLE_VERTICAL

public static final int PARAGRAPH_BORDER_TABLE_VERTICAL
possible border settting

PARAGRAPH_BORDER_TOP

public static final int PARAGRAPH_BORDER_TOP
possible border settting

PARAGRAPH_INDENT_FIRST_LINE

public static final String PARAGRAPH_INDENT_FIRST_LINE

PARAGRAPH_INDENT_LEFT

public static final String PARAGRAPH_INDENT_LEFT

PARAGRAPH_INDENT_RIGHT

public static final String PARAGRAPH_INDENT_RIGHT

PARAGRAPH_JUSTIFICATION

public static final String PARAGRAPH_JUSTIFICATION

PGN_DECIMAL

public static final int PGN_DECIMAL
Decimal number format

PGN_LETTER_LOWERCASE

public static final int PGN_LETTER_LOWERCASE
Lowercase Letter

PGN_LETTER_UPPERCASE

public static final int PGN_LETTER_UPPERCASE
Uppercase Letter

PGN_ROMAN_NUMERAL_LOWERCASE

public static final int PGN_ROMAN_NUMERAL_LOWERCASE
Lowercase Roman Numeral

PGN_ROMAN_NUMERAL_UPPERCASE

public static final int PGN_ROMAN_NUMERAL_UPPERCASE
Uppercase Roman Numeral

SBK_COLUMN

public static final int SBK_COLUMN
Section Break Column break

SBK_EVEN

public static final int SBK_EVEN
Section Break Even page break

SBK_NONE

public static final int SBK_NONE
Section Break None

SBK_ODD

public static final int SBK_ODD
Section Break Odd page break

SBK_PAGE

public static final int SBK_PAGE
Section Break Page break

SECTION

public static final String SECTION

SECTION_BREAK_TYPE

public static final String SECTION_BREAK_TYPE

SECTION_NUMBER_OF_COLUMNS

public static final String SECTION_NUMBER_OF_COLUMNS

SECTION_PAGE_NUMBER_FORMAT

public static final String SECTION_PAGE_NUMBER_FORMAT

SECTION_PAGE_NUMBER_POSITION_X

public static final String SECTION_PAGE_NUMBER_POSITION_X

SECTION_PAGE_NUMBER_POSITION_Y

public static final String SECTION_PAGE_NUMBER_POSITION_Y

Method Detail

addRtfPropertyListener

public void addRtfPropertyListener(RtfPropertyListener listener)
Adds a RtfPropertyListener to the RtfProperty.

Parameters: listener the new RtfPropertyListener.

addToProperty

private boolean addToProperty(String propertyName, int propertyValue)
Add the value of the property identified by the parameter.

Parameters: propertyName The property name to set propertyValue The object to set the property value to

Returns: true for handled or false if propertyName is null

addToProperty

private boolean addToProperty(String propertyName, long propertyValue)
Add the value of the property identified by the parameter.

Parameters: propertyName The property name to set propertyValue The object to set the property value to

Returns: true for handled or false if propertyName is null

afterChange

public void afterChange(String propertyName)

beforeChange

public void beforeChange(String propertyName)

getProperties

public HashMap getProperties(String propertyGroup)
Get a group of properties.

Parameters: propertyGroup The group name to obtain.

Returns: Properties object with requested values.

getProperty

public Object getProperty(String propertyName)
Get the value of the property identified by the parameter.

Parameters: propertyName String containing the property name to get

Returns: Property Object requested or null if not found in map.

isModified

public boolean isModified()

Returns: the modified

isModifiedCharacter

public boolean isModifiedCharacter()

Returns: the modifiedCharacter

isModifiedDocument

public boolean isModifiedDocument()

Returns: the modifiedDocument

isModifiedParagraph

public boolean isModifiedParagraph()

Returns: the modifiedParagraph

isModifiedSection

public boolean isModifiedSection()

Returns: the modifiedSection

removeProperty

private boolean removeProperty(String propertyName)

removeRtfPropertyListener

public void removeRtfPropertyListener(RtfPropertyListener listener)
Removes a RtfPropertyListener from the RtfProperty.

Parameters: listener the new RtfPropertyListener.

setModified

public void setModified(String propertyName, boolean modified)

Parameters: propertyName the propertyName that is modified modified the modified to set

setModifiedCharacter

public void setModifiedCharacter(boolean modifiedCharacter)

Parameters: modifiedCharacter the modifiedCharacter to set

setModifiedDocument

public void setModifiedDocument(boolean modifiedDocument)

Parameters: modifiedDocument the modifiedDocument to set

setModifiedParagraph

public void setModifiedParagraph(boolean modifiedParagraph)

Parameters: modifiedParagraph the modifiedParagraph to set

setModifiedSection

public void setModifiedSection(boolean modifiedSection)

Parameters: modifiedSection the modifiedSection to set

setProperty

public boolean setProperty(RtfCtrlWordData ctrlWordData)
Set the value of the property identified by the parameter.

Parameters: ctrlWordData The controlword with the name to set

Returns: true for handled or false if propertyName or propertyValue is null

setProperty

private boolean setProperty(String propertyName, Object propertyValueNew)
Set the value of the property identified by the parameter.

Parameters: propertyName The property name to set propertyValueNew The object to set the property value to

Returns: true for handled or false if propertyName or propertyValue is null

setProperty

private boolean setProperty(String propertyName, int propertyValueNew)
Set the value of the property identified by the parameter.

Parameters: propertyName The property name to set propertyValueNew The object to set the property value to

Returns: true for handled or false if propertyName is null

setProperty

private boolean setProperty(String propertyName, long propertyValueNew)
Set the value of the property identified by the parameter.

Parameters: propertyName The property name to set propertyValueNew The object to set the property value to

Returns: true for handled or false if propertyName is null

setToDefault

public void setToDefault()
Set all property objects to default values.

Since: 2.0.8

setToDefault

public void setToDefault(String propertyGroup)
Set individual property group to default values.

Parameters: propertyGroup String name of the property group to set to default.

Since: 2.0.8

toggleProperty

public boolean toggleProperty(RtfCtrlWordData ctrlWordData)
Toggle the value of the property identified by the RtfCtrlWordData.specialHandler parameter. Toggle values are assumed to be integer values per the RTF spec with a value of 0=off or 1=on.

Parameters: ctrlWordData The property name to set

Returns: true for handled or false if propertyName is null or blank