Class RtfProperty
- java.lang.Object
-
- com.lowagie.text.rtf.parser.properties.RtfProperty
-
public class RtfProperty extends java.lang.Object
RtfProperty
handles document, paragraph, etc. property values- Since:
- 2.0.8
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CHARACTER
static java.lang.String
CHARACTER_BOLD
static java.lang.String
CHARACTER_FONT
static java.lang.String
CHARACTER_ITALIC
static java.lang.String
CHARACTER_SIZE
static java.lang.String
CHARACTER_STYLE
static java.lang.String
CHARACTER_UNDERLINE
static java.lang.String
COLOR
static java.lang.String
COLOR_BG
static java.lang.String
COLOR_FG
static java.lang.String
DOCUMENT
static java.lang.String
DOCUMENT_DEFAULT_FONT_NUMER
static java.lang.String
DOCUMENT_ENABLE_FACING_PAGES
static java.lang.String
DOCUMENT_MARGIN_BOTTOM_TWIPS
static java.lang.String
DOCUMENT_MARGIN_LEFT_TWIPS
static java.lang.String
DOCUMENT_MARGIN_RIGHT_TWIPS
static java.lang.String
DOCUMENT_MARGIN_TOP_TWIPS
static java.lang.String
DOCUMENT_PAGE_HEIGHT_TWIPS
static java.lang.String
DOCUMENT_PAGE_NUMBER_START
static java.lang.String
DOCUMENT_PAGE_ORIENTATION
static java.lang.String
DOCUMENT_PAGE_WIDTH_TWIPS
static int
JUSTIFY_CENTER
Justify centerstatic int
JUSTIFY_FULL
Justify fullstatic int
JUSTIFY_LEFT
Justify leftstatic int
JUSTIFY_RIGHT
Justify rightprivate java.util.List<RtfPropertyListener>
listeners
TheRtfPropertyListener
.private boolean
modifiedCharacter
private boolean
modifiedDocument
private boolean
modifiedParagraph
private boolean
modifiedSection
static int
OFF
static int
ON
static java.lang.String
PAGE_LANDSCAPE
Landscape orientationstatic java.lang.String
PAGE_PORTRAIT
Portrait orientationstatic java.lang.String
PARAGRAPH
static java.lang.String
PARAGRAPH_BORDER
static int
PARAGRAPH_BORDER_BOTTOM
possible border setttingstatic java.lang.String
PARAGRAPH_BORDER_CELL
static int
PARAGRAPH_BORDER_DIAGONAL_UL_LR
possible border setttingstatic int
PARAGRAPH_BORDER_DIAGONAL_UR_LL
possible border setttingstatic int
PARAGRAPH_BORDER_LEFT
possible border setttingstatic int
PARAGRAPH_BORDER_NIL
possible border setttingstatic int
PARAGRAPH_BORDER_RIGHT
possible border setttingstatic int
PARAGRAPH_BORDER_TABLE_HORIZONTAL
possible border setttingstatic int
PARAGRAPH_BORDER_TABLE_VERTICAL
possible border setttingstatic int
PARAGRAPH_BORDER_TOP
possible border setttingstatic java.lang.String
PARAGRAPH_INDENT_FIRST_LINE
static java.lang.String
PARAGRAPH_INDENT_LEFT
static java.lang.String
PARAGRAPH_INDENT_RIGHT
static java.lang.String
PARAGRAPH_JUSTIFICATION
static int
PGN_DECIMAL
Decimal number formatstatic int
PGN_LETTER_LOWERCASE
Lowercase Letterstatic int
PGN_LETTER_UPPERCASE
Uppercase Letterstatic int
PGN_ROMAN_NUMERAL_LOWERCASE
Lowercase Roman Numeralstatic int
PGN_ROMAN_NUMERAL_UPPERCASE
Uppercase Roman Numeralprotected java.util.Map<java.lang.String,java.lang.Object>
properties
Properties for this RtfProperty objectstatic int
SBK_COLUMN
Section Break Column breakstatic int
SBK_EVEN
Section Break Even page breakstatic int
SBK_NONE
Section Break Nonestatic int
SBK_ODD
Section Break Odd page breakstatic int
SBK_PAGE
Section Break Page breakstatic java.lang.String
SECTION
static java.lang.String
SECTION_BREAK_TYPE
static java.lang.String
SECTION_NUMBER_OF_COLUMNS
static java.lang.String
SECTION_PAGE_NUMBER_FORMAT
static java.lang.String
SECTION_PAGE_NUMBER_POSITION_X
static java.lang.String
SECTION_PAGE_NUMBER_POSITION_Y
-
Constructor Summary
Constructors Constructor Description RtfProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRtfPropertyListener(RtfPropertyListener listener)
Adds aRtfPropertyListener
to theRtfProperty
.private boolean
addToProperty(java.lang.String propertyName, int propertyValue)
Add the value of the property identified by the parameter.private boolean
addToProperty(java.lang.String propertyName, long propertyValue)
Add the value of the property identified by the parameter.void
afterChange(java.lang.String propertyName)
void
beforeChange(java.lang.String propertyName)
java.util.HashMap<java.lang.String,java.lang.Object>
getProperties(java.lang.String propertyGroup)
Get a group of properties.java.lang.Object
getProperty(java.lang.String propertyName)
Get the value of the property identified by the parameter.boolean
isModified()
boolean
isModifiedCharacter()
boolean
isModifiedDocument()
boolean
isModifiedParagraph()
boolean
isModifiedSection()
private boolean
removeProperty(java.lang.String propertyName)
void
removeRtfPropertyListener(RtfPropertyListener listener)
Removes aRtfPropertyListener
from theRtfProperty
.void
setModified(java.lang.String propertyName, boolean modified)
void
setModifiedCharacter(boolean modifiedCharacter)
void
setModifiedDocument(boolean modifiedDocument)
void
setModifiedParagraph(boolean modifiedParagraph)
void
setModifiedSection(boolean modifiedSection)
boolean
setProperty(RtfCtrlWordData ctrlWordData)
Set the value of the property identified by the parameter.private boolean
setProperty(java.lang.String propertyName, int propertyValueNew)
Set the value of the property identified by the parameter.private boolean
setProperty(java.lang.String propertyName, long propertyValueNew)
Set the value of the property identified by the parameter.private boolean
setProperty(java.lang.String propertyName, java.lang.Object propertyValueNew)
Set the value of the property identified by the parameter.void
setToDefault()
Set all property objects to default values.void
setToDefault(java.lang.String propertyGroup)
Set individual property group to default values.boolean
toggleProperty(RtfCtrlWordData ctrlWordData)
Toggle the value of the property identified by theRtfCtrlWordData.specialHandler
parameter.
-
-
-
Field Detail
-
OFF
public static final int OFF
- See Also:
- Constant Field Values
-
ON
public static final int ON
- See Also:
- Constant Field Values
-
COLOR
public static final java.lang.String COLOR
- See Also:
- Constant Field Values
-
CHARACTER
public static final java.lang.String CHARACTER
- See Also:
- Constant Field Values
-
PARAGRAPH
public static final java.lang.String PARAGRAPH
- See Also:
- Constant Field Values
-
SECTION
public static final java.lang.String SECTION
- See Also:
- Constant Field Values
-
DOCUMENT
public static final java.lang.String DOCUMENT
- See Also:
- Constant Field Values
-
COLOR_FG
public static final java.lang.String COLOR_FG
- See Also:
- Constant Field Values
-
COLOR_BG
public static final java.lang.String COLOR_BG
- See Also:
- Constant Field Values
-
CHARACTER_BOLD
public static final java.lang.String CHARACTER_BOLD
- See Also:
- Constant Field Values
-
CHARACTER_UNDERLINE
public static final java.lang.String CHARACTER_UNDERLINE
- See Also:
- Constant Field Values
-
CHARACTER_ITALIC
public static final java.lang.String CHARACTER_ITALIC
- See Also:
- Constant Field Values
-
CHARACTER_SIZE
public static final java.lang.String CHARACTER_SIZE
- See Also:
- Constant Field Values
-
CHARACTER_FONT
public static final java.lang.String CHARACTER_FONT
- See Also:
- Constant Field Values
-
CHARACTER_STYLE
public static final java.lang.String CHARACTER_STYLE
- See Also:
- Constant Field Values
-
JUSTIFY_LEFT
public static final int JUSTIFY_LEFT
Justify left- See Also:
- Constant Field Values
-
JUSTIFY_RIGHT
public static final int JUSTIFY_RIGHT
Justify right- See Also:
- Constant Field Values
-
JUSTIFY_CENTER
public static final int JUSTIFY_CENTER
Justify center- See Also:
- Constant Field Values
-
JUSTIFY_FULL
public static final int JUSTIFY_FULL
Justify full- See Also:
- Constant Field Values
-
PARAGRAPH_INDENT_LEFT
public static final java.lang.String PARAGRAPH_INDENT_LEFT
- See Also:
- Constant Field Values
-
PARAGRAPH_INDENT_RIGHT
public static final java.lang.String PARAGRAPH_INDENT_RIGHT
- See Also:
- Constant Field Values
-
PARAGRAPH_INDENT_FIRST_LINE
public static final java.lang.String PARAGRAPH_INDENT_FIRST_LINE
- See Also:
- Constant Field Values
-
PARAGRAPH_JUSTIFICATION
public static final java.lang.String PARAGRAPH_JUSTIFICATION
- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER
public static final java.lang.String PARAGRAPH_BORDER
- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_CELL
public static final java.lang.String PARAGRAPH_BORDER_CELL
- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_NIL
public static final int PARAGRAPH_BORDER_NIL
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_BOTTOM
public static final int PARAGRAPH_BORDER_BOTTOM
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_TOP
public static final int PARAGRAPH_BORDER_TOP
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_LEFT
public static final int PARAGRAPH_BORDER_LEFT
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_RIGHT
public static final int PARAGRAPH_BORDER_RIGHT
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_DIAGONAL_UL_LR
public static final int PARAGRAPH_BORDER_DIAGONAL_UL_LR
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_DIAGONAL_UR_LL
public static final int PARAGRAPH_BORDER_DIAGONAL_UR_LL
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_TABLE_HORIZONTAL
public static final int PARAGRAPH_BORDER_TABLE_HORIZONTAL
possible border settting- See Also:
- Constant Field Values
-
PARAGRAPH_BORDER_TABLE_VERTICAL
public static final int PARAGRAPH_BORDER_TABLE_VERTICAL
possible border settting- See Also:
- Constant Field Values
-
PGN_DECIMAL
public static final int PGN_DECIMAL
Decimal number format- See Also:
- Constant Field Values
-
PGN_ROMAN_NUMERAL_UPPERCASE
public static final int PGN_ROMAN_NUMERAL_UPPERCASE
Uppercase Roman Numeral- See Also:
- Constant Field Values
-
PGN_ROMAN_NUMERAL_LOWERCASE
public static final int PGN_ROMAN_NUMERAL_LOWERCASE
Lowercase Roman Numeral- See Also:
- Constant Field Values
-
PGN_LETTER_UPPERCASE
public static final int PGN_LETTER_UPPERCASE
Uppercase Letter- See Also:
- Constant Field Values
-
PGN_LETTER_LOWERCASE
public static final int PGN_LETTER_LOWERCASE
Lowercase Letter- See Also:
- Constant Field Values
-
SBK_NONE
public static final int SBK_NONE
Section Break None- See Also:
- Constant Field Values
-
SBK_COLUMN
public static final int SBK_COLUMN
Section Break Column break- See Also:
- Constant Field Values
-
SBK_EVEN
public static final int SBK_EVEN
Section Break Even page break- See Also:
- Constant Field Values
-
SBK_ODD
public static final int SBK_ODD
Section Break Odd page break- See Also:
- Constant Field Values
-
SBK_PAGE
public static final int SBK_PAGE
Section Break Page break- See Also:
- Constant Field Values
-
SECTION_NUMBER_OF_COLUMNS
public static final java.lang.String SECTION_NUMBER_OF_COLUMNS
- See Also:
- Constant Field Values
-
SECTION_BREAK_TYPE
public static final java.lang.String SECTION_BREAK_TYPE
- See Also:
- Constant Field Values
-
SECTION_PAGE_NUMBER_POSITION_X
public static final java.lang.String SECTION_PAGE_NUMBER_POSITION_X
- See Also:
- Constant Field Values
-
SECTION_PAGE_NUMBER_POSITION_Y
public static final java.lang.String SECTION_PAGE_NUMBER_POSITION_Y
- See Also:
- Constant Field Values
-
SECTION_PAGE_NUMBER_FORMAT
public static final java.lang.String SECTION_PAGE_NUMBER_FORMAT
- See Also:
- Constant Field Values
-
PAGE_PORTRAIT
public static final java.lang.String PAGE_PORTRAIT
Portrait orientation- See Also:
- Constant Field Values
-
PAGE_LANDSCAPE
public static final java.lang.String PAGE_LANDSCAPE
Landscape orientation- See Also:
- Constant Field Values
-
DOCUMENT_PAGE_WIDTH_TWIPS
public static final java.lang.String DOCUMENT_PAGE_WIDTH_TWIPS
- See Also:
- Constant Field Values
-
DOCUMENT_PAGE_HEIGHT_TWIPS
public static final java.lang.String DOCUMENT_PAGE_HEIGHT_TWIPS
- See Also:
- Constant Field Values
-
DOCUMENT_MARGIN_LEFT_TWIPS
public static final java.lang.String DOCUMENT_MARGIN_LEFT_TWIPS
- See Also:
- Constant Field Values
-
DOCUMENT_MARGIN_TOP_TWIPS
public static final java.lang.String DOCUMENT_MARGIN_TOP_TWIPS
- See Also:
- Constant Field Values
-
DOCUMENT_MARGIN_RIGHT_TWIPS
public static final java.lang.String DOCUMENT_MARGIN_RIGHT_TWIPS
- See Also:
- Constant Field Values
-
DOCUMENT_MARGIN_BOTTOM_TWIPS
public static final java.lang.String DOCUMENT_MARGIN_BOTTOM_TWIPS
- See Also:
- Constant Field Values
-
DOCUMENT_PAGE_NUMBER_START
public static final java.lang.String DOCUMENT_PAGE_NUMBER_START
- See Also:
- Constant Field Values
-
DOCUMENT_ENABLE_FACING_PAGES
public static final java.lang.String DOCUMENT_ENABLE_FACING_PAGES
- See Also:
- Constant Field Values
-
DOCUMENT_PAGE_ORIENTATION
public static final java.lang.String DOCUMENT_PAGE_ORIENTATION
- See Also:
- Constant Field Values
-
DOCUMENT_DEFAULT_FONT_NUMER
public static final java.lang.String DOCUMENT_DEFAULT_FONT_NUMER
- See Also:
- Constant Field Values
-
properties
protected final java.util.Map<java.lang.String,java.lang.Object> properties
Properties for this RtfProperty object
-
modifiedCharacter
private boolean modifiedCharacter
-
modifiedParagraph
private boolean modifiedParagraph
-
modifiedSection
private boolean modifiedSection
-
modifiedDocument
private boolean modifiedDocument
-
listeners
private final java.util.List<RtfPropertyListener> listeners
TheRtfPropertyListener
.
-
-
Method Detail
-
setToDefault
public void setToDefault()
Set all property objects to default values.- Since:
- 2.0.8
-
setToDefault
public void setToDefault(java.lang.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 theRtfCtrlWordData.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 orfalse
ifpropertyName
isnull
or blank
-
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 orfalse
ifpropertyName
orpropertyValue
isnull
-
setProperty
private boolean setProperty(java.lang.String propertyName, java.lang.Object propertyValueNew)
Set the value of the property identified by the parameter.- Parameters:
propertyName
- The property name to setpropertyValueNew
- The object to set the property value to- Returns:
true
for handled orfalse
ifpropertyName
orpropertyValue
isnull
-
setProperty
private boolean setProperty(java.lang.String propertyName, int propertyValueNew)
Set the value of the property identified by the parameter.- Parameters:
propertyName
- The property name to setpropertyValueNew
- The object to set the property value to- Returns:
true
for handled orfalse
ifpropertyName
isnull
-
addToProperty
private boolean addToProperty(java.lang.String propertyName, int propertyValue)
Add the value of the property identified by the parameter.- Parameters:
propertyName
- The property name to setpropertyValue
- The object to set the property value to- Returns:
true
for handled orfalse
ifpropertyName
isnull
-
setProperty
private boolean setProperty(java.lang.String propertyName, long propertyValueNew)
Set the value of the property identified by the parameter.- Parameters:
propertyName
- The property name to setpropertyValueNew
- The object to set the property value to- Returns:
true
for handled orfalse
ifpropertyName
isnull
-
addToProperty
private boolean addToProperty(java.lang.String propertyName, long propertyValue)
Add the value of the property identified by the parameter.- Parameters:
propertyName
- The property name to setpropertyValue
- The object to set the property value to- Returns:
true
for handled orfalse
ifpropertyName
isnull
-
removeProperty
private boolean removeProperty(java.lang.String propertyName)
-
getProperty
public java.lang.Object getProperty(java.lang.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.
-
getProperties
public java.util.HashMap<java.lang.String,java.lang.Object> getProperties(java.lang.String propertyGroup)
Get a group of properties.- Parameters:
propertyGroup
- The group name to obtain.- Returns:
- Properties object with requested values.
-
isModified
public boolean isModified()
- Returns:
- the modified
-
setModified
public void setModified(java.lang.String propertyName, boolean modified)
- Parameters:
propertyName
- the propertyName that is modifiedmodified
- the modified to set
-
isModifiedCharacter
public boolean isModifiedCharacter()
- Returns:
- the modifiedCharacter
-
setModifiedCharacter
public void setModifiedCharacter(boolean modifiedCharacter)
- Parameters:
modifiedCharacter
- the modifiedCharacter to set
-
isModifiedParagraph
public boolean isModifiedParagraph()
- Returns:
- the modifiedParagraph
-
setModifiedParagraph
public void setModifiedParagraph(boolean modifiedParagraph)
- Parameters:
modifiedParagraph
- the modifiedParagraph to set
-
isModifiedSection
public boolean isModifiedSection()
- Returns:
- the modifiedSection
-
setModifiedSection
public void setModifiedSection(boolean modifiedSection)
- Parameters:
modifiedSection
- the modifiedSection to set
-
isModifiedDocument
public boolean isModifiedDocument()
- Returns:
- the modifiedDocument
-
setModifiedDocument
public void setModifiedDocument(boolean modifiedDocument)
- Parameters:
modifiedDocument
- the modifiedDocument to set
-
addRtfPropertyListener
public void addRtfPropertyListener(RtfPropertyListener listener)
Adds aRtfPropertyListener
to theRtfProperty
.- Parameters:
listener
- the new RtfPropertyListener.
-
removeRtfPropertyListener
public void removeRtfPropertyListener(RtfPropertyListener listener)
Removes aRtfPropertyListener
from theRtfProperty
.- Parameters:
listener
- the new RtfPropertyListener.
-
beforeChange
public void beforeChange(java.lang.String propertyName)
-
afterChange
public void afterChange(java.lang.String propertyName)
-
-