mnabeelkhan / tableexport-for-vaadin

Automatically exported from code.google.com/p/tableexport-for-vaadin
0 stars 0 forks source link

could you please align the header cells in the same way (as regular cells) #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
could you please align the header cells in the same way (as regular cells)

see:
http://vaadin.com/forum/-/message_boards/view_message/579716

Original issue reported on code.google.com by jnas...@gmail.com on 12 Sep 2011 at 2:13

GoogleCodeExporter commented 8 years ago
Easy fix.  Did same alignment in addHeaderRow as was previously done in 
addDataRow. Broke out a separate alignCell utility method:

    private void alignCell(final Cell sheetCell, final String vaadinAlignment) {
        if (Table.ALIGN_LEFT.equals(vaadinAlignment)) {
            sheetCell.getCellStyle().setAlignment(CellStyle.ALIGN_LEFT);
        } else if (Table.ALIGN_RIGHT.equals(vaadinAlignment)) {
            sheetCell.getCellStyle().setAlignment(CellStyle.ALIGN_RIGHT);
        } else {
            sheetCell.getCellStyle().setAlignment(CellStyle.ALIGN_CENTER);
        }
    }

Original comment by jnas...@gmail.com on 17 Sep 2011 at 2:46