Class RtfProperty


  • public class RtfProperty
    extends java.lang.Object
    RtfProperty handles document, paragraph, etc. property values
    Since:
    2.0.8
    • Field Detail

      • 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
      • 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_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_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
      • 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
        The RtfPropertyListener.
    • Constructor Detail

      • RtfProperty

        public RtfProperty()
    • 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 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
      • 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​(java.lang.String propertyName,
                                    java.lang.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​(java.lang.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
      • 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 set
        propertyValue - The object to set the property value to
        Returns:
        true for handled or false if propertyName is null
      • 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 set
        propertyValueNew - The object to set the property value to
        Returns:
        true for handled or false if propertyName is null
      • 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 set
        propertyValue - The object to set the property value to
        Returns:
        true for handled or false if propertyName is null
      • 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 modified
        modified - 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 a RtfPropertyListener to the RtfProperty.
        Parameters:
        listener - the new RtfPropertyListener.
      • removeRtfPropertyListener

        public void removeRtfPropertyListener​(RtfPropertyListener listener)
        Removes a RtfPropertyListener from the RtfProperty.
        Parameters:
        listener - the new RtfPropertyListener.
      • beforeChange

        public void beforeChange​(java.lang.String propertyName)
      • afterChange

        public void afterChange​(java.lang.String propertyName)