Class RtfTableCell

    • Field Detail

      • DEFAULT_CELL_WIDTH

        public static final int DEFAULT_CELL_WIDTH
        default cell width (in twips ??)
        See Also:
        Constant Field Values
      • NO_MERGE

        public static final int NO_MERGE
        cell merging: this cell is not merged
        See Also:
        Constant Field Values
      • MERGE_START

        public static final int MERGE_START
        cell merging: this cell is the start of a range of merged cells
        See Also:
        Constant Field Values
      • MERGE_WITH_PREVIOUS

        public static final int MERGE_WITH_PREVIOUS
        cell merging: this cell is part of (but not the start of) a range of merged cells
        See Also:
        Constant Field Values
    • Method Detail

      • newParagraph

        public RtfParagraph newParagraph​(RtfAttributes attrs)
                                  throws java.io.IOException
        Start a new paragraph after closing current current paragraph, list and table
        Specified by:
        newParagraph in interface IRtfParagraphContainer
        Parameters:
        attrs - attributes of new RtfParagraph
        Returns:
        new RtfParagraph object
        Throws:
        java.io.IOException - for I/O problems
      • newImage

        public RtfExternalGraphic newImage()
                                    throws java.io.IOException
        Start a new external graphic after closing current paragraph, list and table
        Specified by:
        newImage in interface IRtfExternalGraphicContainer
        Returns:
        new RtfExternalGraphic object
        Throws:
        java.io.IOException - for I/O problems
      • newParagraph

        public RtfParagraph newParagraph()
                                  throws java.io.IOException
        Start a new paragraph with default attributes after closing current paragraph, list and table
        Specified by:
        newParagraph in interface IRtfParagraphContainer
        Returns:
        new RtfParagraph object
        Throws:
        java.io.IOException - for I/O problems
      • newList

        public RtfList newList​(RtfAttributes attrib)
                        throws java.io.IOException
        Start a new list after closing current paragraph, list and table
        Specified by:
        newList in interface IRtfListContainer
        Parameters:
        attrib - attributes for new RtfList
        Returns:
        new RtfList object
        Throws:
        java.io.IOException - for I/O problems
      • newTable

        public RtfTable newTable​(ITableColumnsInfo tc)
                          throws java.io.IOException
        Start a new nested table after closing current paragraph, list and table
        Specified by:
        newTable in interface IRtfTableContainer
        Parameters:
        tc - table column info for new RtfTable
        Returns:
        new RtfTable object
        Throws:
        java.io.IOException - for I/O problems
      • newTable

        public RtfTable newTable​(RtfAttributes attrs,
                                 ITableColumnsInfo tc)
                          throws java.io.IOException
        Start a new nested table after closing current paragraph, list and table
        Specified by:
        newTable in interface IRtfTableContainer
        Parameters:
        attrs - attributes of new RtfTable
        tc - table column info for new RtfTable
        Returns:
        new RtfTable object
        Throws:
        java.io.IOException - for I/O problems
      • writeRtfContent

        protected void writeRtfContent()
                                throws java.io.IOException
        Overriden to avoid writing any it's a merged cell.
        Overrides:
        writeRtfContent in class RtfContainer
        Throws:
        java.io.IOException - for I/O problems
      • writeRtfPrefix

        protected void writeRtfPrefix()
                               throws java.io.IOException
        Called before writeRtfContent; overriden to avoid writing any it's a merged cell.
        Overrides:
        writeRtfPrefix in class RtfElement
        Throws:
        java.io.IOException - for I/O problems
      • writeRtfSuffix

        protected void writeRtfSuffix()
                               throws java.io.IOException
        The "cell" control word marks the end of a cell
        Overrides:
        writeRtfSuffix in class RtfElement
        Throws:
        java.io.IOException - for I/O problems
      • setVMerge

        public void setVMerge​(int mergeStatus)
        Parameters:
        mergeStatus - vertical cell merging status to set
      • getVMerge

        public int getVMerge()
        Returns:
        vertical cell merging status
      • setHMerge

        public void setHMerge​(int mergeStatus)
        Set horizontal cell merging status
        Parameters:
        mergeStatus - mergeStatus to set
      • getHMerge

        public int getHMerge()
        Returns:
        horizontal cell merging status
      • isEmpty

        public boolean isEmpty()
        A table cell always contains "useful" content, as it is here to take some space in a row. Use containsText() to find out if there is really some useful content in the cell. TODO: containsText could use the original isEmpty implementation?
        Overrides:
        isEmpty in class RtfContainer
        Returns:
        false (always)
      • getTextrun

        public RtfTextrun getTextrun()
                              throws java.io.IOException
        Returns the current RtfTextrun object. Opens a new one if necessary.
        Specified by:
        getTextrun in interface IRtfTextrunContainer
        Returns:
        The RtfTextrun object
        Throws:
        java.io.IOException - Thrown when an IO-problem occurs
      • getRow

        public RtfTableRow getRow()
        Get the parent row.
        Returns:
        The parent row.
      • setLastParagraph

        public void setLastParagraph​(RtfParagraphBreak parBreak,
                                     int breakDepth)
        The table cell decides whether or not a newly added paragraph break will be used to write the cell-end control word. For nested tables it is not necessary.
        Parameters:
        parBreak - the paragraph break element
        breakDepth - The depth is necessary for picking the correct break element. If it is deeper inside the whole cell it will be used, and if there is something on the same level (depth) it is also set because the method is called for all breaks in the correct order.
      • finish

        public void finish()
        The last paragraph break was just stored before, now the control word is really switched