Package org.apache.poi.xssf.usermodel

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


           else if ("str".equals(cellType))
               nextDataType = xssfDataType.FORMULA;
           else if (cellStyleStr != null) {
              // Number, but almost certainly with a special style or format
               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


    // 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

                    nextDataType = xssfDataType.FORMULA;
                else 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);
                    this.formatIndex = style.getDataFormat();
                    this.formatString = style.getDataFormatString();
                    if (this.formatString == null)
                        this.formatString = BuiltinFormats.getBuiltinFormat(this.formatIndex);
                }
            }
View Full Code Here

    public XSSFHtmlHelper(XSSFWorkbook wb) {
        this.wb = wb;
    }

    public void colorStyles(CellStyle style, Formatter out) {
        XSSFCellStyle cs = (XSSFCellStyle) style;
        styleColor(out, "background-color", cs.getFillForegroundXSSFColor());
        styleColor(out, "text-color", cs.getFont().getXSSFColor());
    }
View Full Code Here

    int nf1 = st.putNumberFormat("yyyy-mm-dd");
    int nf2 = st.putNumberFormat("yyyy-mm-DD");
    assertEquals(nf1, st.putNumberFormat("yyyy-mm-dd"));

    st.putStyle(new XSSFCellStyle(st));

    // Save and re-load
    st = XSSFTestDataSamples.writeOutAndReadBack(wb).getStylesSource();

    assertNotNull(st.getCTStylesheet());
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

            XSSFColor color = font.getXSSFColor();
            assertEquals("Failed color theme "+i, rgbExpected[i], Hex.encodeHexString(color.getRgb()));
            long themeIdx = font.getCTFont().getColorArray(0).getTheme();
            assertEquals("Failed color theme "+i, i, themeIdx);
            if (createFile) {
                XSSFCellStyle cs = (XSSFCellStyle)row.getSheet().getWorkbook().createCellStyle();
                cs.setFillForegroundColor(color);
                cs.setFillPattern(CellStyle.SOLID_FOREGROUND);
                row.createCell(1).setCellStyle(cs);
            }
            i++;
        }
       
View Full Code Here

               nextDataType = xssfDataType.SST_STRING;
           else if ("str".equals(cellType))
               nextDataType = xssfDataType.FORMULA;
           else {
               // Number, but almost certainly with a special style or format
               XSSFCellStyle style = null;
               if (cellStyleStr != null) {
                   int styleIndex = Integer.parseInt(cellStyleStr);
                   style = stylesTable.getStyleAt(styleIndex);
               } else if (stylesTable.getNumCellStyles() > 0) {
                   style = stylesTable.getStyleAt(0);
               }
               if (style != null) {
                   this.formatIndex = style.getDataFormat();
                   this.formatString = style.getDataFormatString();
                   if (this.formatString == null)
                       this.formatString = BuiltinFormats.getBuiltinFormat(this.formatIndex);
               }
           }
       }
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.