Class TableBuilder

    • Constructor Detail

      • TableBuilder

        public TableBuilder​(XlsSheetGridModel gridModel)
        Creates new instance.
        Parameters:
        gridModel - represents interface for operations with excel sheets
    • Method Detail

      • beginTable

        public void beginTable​(int width,
                               int height)
                        throws CreateTableException
        Begins writing a table.
        Parameters:
        width - table width in cells
        height - table height in cells
        Throws:
        CreateTableException - if unable to create table
        IllegalStateException - if beginTable() has already been called without subsequent endTable()
      • getCurrentRow

        protected int getCurrentRow()
      • getDefaultCellStyle

        protected org.apache.poi.ss.usermodel.CellStyle getDefaultCellStyle()
        Initializes default cell style.
        Returns:
        cell style
      • getDefaultDateCellStyle

        protected org.apache.poi.ss.usermodel.CellStyle getDefaultDateCellStyle()
      • getHeight

        protected int getHeight()
      • getWidth

        protected int getWidth()
      • incCurrentRow

        protected void incCurrentRow()
      • incCurrentRow

        protected void incCurrentRow​(int increment)
      • writeCell

        protected void writeCell​(int x,
                                 int y,
                                 int width,
                                 int height,
                                 Object value)
        Writes cell.
        Parameters:
        x - cell x coordinate
        y - cell y coordinate
        width - cell width
        height - cell height
        value - cell value
      • writeCell

        protected void writeCell​(int x,
                                 int y,
                                 int width,
                                 int height,
                                 Object value,
                                 ICellStyle style)
        Writes cell.
        Parameters:
        x - cell x coordinate
        y - cell y coordinate
        width - cell width
        height - cell height
        value - cell value
        style - cell style
      • writeCell

        protected void writeCell​(int x,
                                 int y,
                                 Object value)
        Writes cell.
        Parameters:
        x - cell x coordinate
        y - cell y coordinate
        value - cell value
      • writeHeader

        public void writeHeader​(String header,
                                ICellStyle style)
        Writes table header.
        Parameters:
        header - header text for the table
        style - header style
        Throws:
        IllegalStateException - if method is called without prior beginTable() call