Documentation of 'org.apache.poi.xwpf.usermodel.XWPFTableCell' Java class
XWPFTableCell
org.apache.poi.xwpf.usermodel

Class XWPFTableCell

  • All Implemented Interfaces:
    IBody, ICell


    public class XWPFTableCell
    extends java.lang.Object
    implements IBody, ICell
    Represents a Cell within a XWPFTable. The Cell is the thing that holds the actual content (paragraphs etc)
    • Constructor Detail

      • XWPFTableCell

        public XWPFTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell,
                             XWPFTableRow tableRow,
                             IBody part)
        If a table cell does not include at least one block-level element, then this document shall be considered corrupt
    • Method Detail

      • getCTTc

        @Internal
        public org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc getCTTc()
      • addParagraph

        public XWPFParagraph addParagraph()
        Add a Paragraph to this Table Cell
        Returns:
        The paragraph which was added
      • addParagraph

        public void addParagraph(XWPFParagraph p)
        add a Paragraph to this TableCell
        Parameters:
        p - the paragaph which has to be added
      • removeParagraph

        public void removeParagraph(int pos)
        removes a paragraph of this tablecell
        Parameters:
        pos -
      • getParagraph

        public XWPFParagraph getParagraph(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP p)
        if there is a corresponding XWPFParagraph of the parameter ctTable in the paragraphList of this table the method will return this paragraph if there is no corresponding XWPFParagraph the method will return null
        Specified by:
        getParagraph in interface IBody
        Parameters:
        p - is instance of CTP and is searching for an XWPFParagraph
        Returns:
        null if there is no XWPFParagraph with an corresponding CTPparagraph in the paragraphList of this table XWPFParagraph with the correspondig CTP p
      • setText

        public void setText(java.lang.String text)
      • setColor

        public void setColor(java.lang.String rgbStr)
        Set cell color. This sets some associated values; for finer control you may want to access these elements individually.
        Parameters:
        rgbStr - - the desired cell color, in the hex form "RRGGBB".
      • getColor

        public java.lang.String getColor()
        Get cell color. Note that this method only returns the "fill" value.
        Returns:
        RGB string of cell color
      • setVerticalAlignment

        public void setVerticalAlignment(XWPFTableCell.XWPFVertAlign vAlign)
        Set the vertical alignment of the cell.
        Parameters:
        vAlign - - the desired alignment enum value
      • getVerticalAlignment

        public XWPFTableCell.XWPFVertAlign getVerticalAlignment()
        Get the vertical alignment of the cell.
        Returns:
        the cell alignment enum value
      • insertNewParagraph

        public XWPFParagraph insertNewParagraph(org.apache.xmlbeans.XmlCursor cursor)
        add a new paragraph at position of the cursor
        Specified by:
        insertNewParagraph in interface IBody
        Parameters:
        cursor -
        Returns:
        the inserted paragraph
      • insertNewTbl

        public XWPFTable insertNewTbl(org.apache.xmlbeans.XmlCursor cursor)
        Description copied from interface: IBody
        inserts a new Table at the cursor position.
        Specified by:
        insertNewTbl in interface IBody
      • getPartType

        public BodyType getPartType()
        Description copied from interface: IBody
        get the PartType of the body, for example DOCUMENT, HEADER, FOOTER, FOOTNOTE,
        Specified by:
        getPartType in interface IBody
        Returns:
        the PartType of the body
        See Also:
        IBody.getPartType()
      • getTables

        public java.util.List<XWPFTable> getTables()
        Description copied from interface: IBody
        Return the table(s) that holds the text of the IBodyPart, for complex cases where a paragraph isn't used.
        Specified by:
        getTables in interface IBody
        See Also:
        IBody.getTables()
      • getText

        public java.lang.String getText()
      • getTextRecursively

        public java.lang.String getTextRecursively()
        extracts all text recursively through embedded tables and embedded SDTs
      • getTableCell

        public XWPFTableCell getTableCell(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc cell)
        get the TableCell which belongs to the TableCell
        Specified by:
        getTableCell in interface IBody

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.