Package org.apache.poi.xssf.usermodel

Examples of org.apache.poi.xssf.usermodel.XSSFCellStyle


    if (cell.isUnderline()) {
      font.setUnderline(Font.U_SINGLE);
    }

    XSSFCellStyle style = workbook.createCellStyle();
    style.setAlignment(this.getAlignment(cell.getAlignment()));
    style.setVerticalAlignment(this.getVerticalAlignment(cell.getVerticalAlignment()));
    style.setWrapText(cell.isWrap());
    style.setFont(font);

    if (cell.getLeftBorder() != null) {
      style.setBorderLeft((short) cell.getLeftBorder().getWidth());
      style.setLeftBorderColor(this.getColor(cell.getLeftBorder().getColor()));
    }

    if (cell.getTopBorder() != null) {
      style.setBorderTop((short) cell.getTopBorder().getWidth());
      style.setTopBorderColor(this.getColor(cell.getTopBorder().getColor()));
    }

    if (cell.getRightBorder() != null) {
      style.setBorderRight((short) cell.getRightBorder().getWidth());
      style.setRightBorderColor(this.getColor(cell.getRightBorder().getColor()));
    }

    if (cell.getBottomBorder() != null) {
      style.setBorderBottom((short) cell.getBottomBorder().getWidth());
      style.setBottomBorderColor(this.getColor(cell.getBottomBorder().getColor()));
    }

    if (cell.getBackgroundColor() != null) {
      style.setFillForegroundColor(this.getBackgroundColor(cell.getBackgroundColor()));
      style.setFillPattern(CellStyle.SOLID_FOREGROUND);
    }

    switch (cell.getType()) {
      case BLANK:
        c.setCellType(org.apache.poi.ss.usermodel.Cell.CELL_TYPE_BLANK);
View Full Code Here


   {
      boolean bDate = false;
      double d = cell.getNumericCellValue();
      if (HSSFDateUtil.isValidExcelDate(d))
      {
         XSSFCellStyle style = cell.getCellStyle();
         int i = style.getDataFormat();
         switch (i)
         {
            case 0xe : // m/d/yy
            case 0xf : // d-mmm-yy
            case 0x10 : // d-mmm
View Full Code Here

TOP

Related Classes of org.apache.poi.xssf.usermodel.XSSFCellStyle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.