Package org.apache.poi.xssf.usermodel

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


    {
      final XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
      final short predefinedStyles = workbook.getNumCellStyles();
      for (short i = 0; i < predefinedStyles; i++)
      {
        final XSSFCellStyle cellStyleAt = xssfWorkbook.getCellStyleAt(i);
        this.styleCache.put(new HSSFCellStyleKey(cellStyleAt), cellStyleAt);
      }
    }
    else
    {
View Full Code Here


    }
    if (bg != null)
    {
      if (hssfCellStyle instanceof XSSFCellStyle)
      {
        final XSSFCellStyle xssfCellStyle = (XSSFCellStyle) hssfCellStyle;
        if (BorderStyle.NONE.equals(bg.getBottom().getBorderStyle()) == false)
        {
          hssfCellStyle.setBorderBottom(styleKey.getBorderStrokeBottom());
          xssfCellStyle.setBorderColor(XSSFCellBorder.BorderSide.BOTTOM,
              new XSSFColor(styleKey.getExtendedColorBottom()));
        }
        if (BorderStyle.NONE.equals(bg.getTop().getBorderStyle()) == false)
        {
          hssfCellStyle.setBorderTop(styleKey.getBorderStrokeTop());
          xssfCellStyle.setBorderColor(XSSFCellBorder.BorderSide.TOP,
              new XSSFColor(styleKey.getExtendedColorTop()));
        }
        if (BorderStyle.NONE.equals(bg.getLeft().getBorderStyle()) == false)
        {
          hssfCellStyle.setBorderLeft(styleKey.getBorderStrokeLeft());
          xssfCellStyle.setBorderColor(XSSFCellBorder.BorderSide.LEFT,
              new XSSFColor(styleKey.getExtendedColorLeft()));
        }
        if (BorderStyle.NONE.equals(bg.getRight().getBorderStyle()) == false)
        {
          hssfCellStyle.setBorderRight(styleKey.getBorderStrokeRight());
          xssfCellStyle.setBorderColor(XSSFCellBorder.BorderSide.RIGHT,
              new XSSFColor(styleKey.getExtendedColorRight()));
        }
        if (bg.getBackgroundColor() != null)
        {
          xssfCellStyle.setFillForegroundColor(new XSSFColor(styleKey.getExtendedColor()));
          hssfCellStyle.setFillPattern(HSSFCellStyle.SOLID_FOREGROUND);
        }
      }
      else
      {
View Full Code Here

    // 0 is the empty default
    if(xfs.get(idx).getXfId() > 0) {
      styleXfId = (int) xfs.get(idx).getXfId();
    }

    return new XSSFCellStyle(idx, styleXfId, this, theme);
  }
View Full Code Here

    xf.setFillId(0);
    xf.setBorderId(0);
    xf.setXfId(0);
    int xfSize = styleXfs.size();
    int indexXf = putCellXf(xf);
    return new XSSFCellStyle(indexXf - 1, xfSize - 1, this, theme);
  }
View Full Code Here

                          * Nick Burch said to use org.apache.poi.ss.usermodel.BuiltinFormats,
                          * and I see javadoc for that at apache.org, but it's not in the
                          * POI 3.5 Beta 5 jars.  Scheduled to appear in 3.5 beta 6.
                          */
                    int styleIndex = Integer.parseInt(cellStyleStr);
                    XSSFCellStyle style = stylesTable.getStyleAt(styleIndex);
                    this.formatIndex = style.getDataFormat();
                    this.formatString = style.getDataFormatString();
                    if (this.formatString == null)
                        this.formatString = BuiltinFormats.getBuiltinFormat(this.formatIndex);
                }
            }

View Full Code Here

            String cellStyleStr = attributes.getValue("s");
            if (cellStyleStr != null) {
                // It's a number, but almost certainly one
                // with a special style or format
                int styleIndex = Integer.parseInt(cellStyleStr);
                XSSFCellStyle style = _stylesTable.getStyleAt(styleIndex);

                configureStyle(style);

                if (_dataType == XssfDataType.NUMBER) {
                    this._formatIndex = style.getDataFormat();
                    this._formatString = style.getDataFormatString();
                    if (this._formatString == null) {
                        this._formatString = BuiltinFormats.getBuiltinFormat(this._formatIndex);
                    }
                }
            }
View Full Code Here

    // 0 is the empty default
    if(xfs.get(idx).getXfId() > 0) {
      styleXfId = (int) xfs.get(idx).getXfId();
    }

    return new XSSFCellStyle(idx, styleXfId, this);
  }
View Full Code Here

        xf.setFillId(0);
        xf.setBorderId(0);
        xf.setXfId(0);
        int xfSize = styleXfs.size();
        int indexXf = putCellXf(xf);
        return new XSSFCellStyle(indexXf - 1, xfSize - 1, this);
    }
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

    {
      final XSSFWorkbook xssfWorkbook = (XSSFWorkbook) workbook;
      final short predefinedStyles = workbook.getNumCellStyles();
      for (short i = 0; i < predefinedStyles; i++)
      {
        final XSSFCellStyle cellStyleAt = xssfWorkbook.getCellStyleAt(i);
        this.styleCache.put(new HSSFCellStyleKey(cellStyleAt), cellStyleAt);
      }
    }
    else
    {
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.