Package org.apache.poi.ss.usermodel

Examples of org.apache.poi.ss.usermodel.StylesSource


    );
    assertTrue(xml.exists());
     
    XSSFWorkbook workbook = new XSSFWorkbook(xml.toString());
   
    StylesSource ss = workbook.getStylesSource();
    assertNotNull(ss);
    assertTrue(ss instanceof StylesTable);
    StylesTable st = (StylesTable)ss;
   
    // Has 8 number formats
View Full Code Here


     
      //get default font, then change 2 values and check against different values (height changes)
      Font font=workbook.createFont();
      ((XSSFFont)font).setBold(true);
      font.setUnderline(Font.U_DOUBLE);
      StylesSource styleSource=new StylesTable();
      long index=styleSource.putFont(font);
      System.out.println("index="+index);
      workbook.setStylesSource(styleSource);
      fontFind=workbook.findFont(Font.BOLDWEIGHT_BOLD, Font.COLOR_NORMAL, (short)15, "Calibri", false, false, Font.SS_NONE, Font.U_DOUBLE);
        assertNull(fontFind);
    }
View Full Code Here

        //get default style
        CellStyle cellStyleAt = workbook.getCellStyleAt(i);
        assertNotNull(cellStyleAt);
       
        //get custom style
        StylesSource styleSource = workbook.getStylesSource();
        CellStyle customStyle = new XSSFCellStyle(styleSource);
        Font font = new XSSFFont();
        font.setFontName("Verdana");
        customStyle.setFont(font);
        Long x = styleSource.putStyle(customStyle);
        cellStyleAt = workbook.getCellStyleAt(x.shortValue());
        assertNotNull(cellStyleAt);       
    }
View Full Code Here

        assertNotNull(cellStyleAt);       
    }
   
    public void testGetFontAt(){
       XSSFWorkbook workbook = new XSSFWorkbook();
        StylesSource styleSource = workbook.getStylesSource();
        short i = 0;
        //get default font
        Font fontAt = workbook.getFontAt(i);
        assertNotNull(fontAt);
       
        //get customized font
        Font customFont = new XSSFFont();
        customFont.setItalic(true);
        Long x = styleSource.putFont(customFont);
        fontAt = workbook.getFontAt(x.shortValue());
        assertNotNull(fontAt);
    }
View Full Code Here

    );
    assertTrue(xml.exists());
     
    XSSFWorkbook workbook = new XSSFWorkbook(xml.toString());
   
    StylesSource ss = workbook.getStylesSource();
    assertNotNull(ss);
    assertTrue(ss instanceof StylesTable);
    StylesTable st = (StylesTable)ss;
   
    // Has 8 number formats
View Full Code Here

TOP

Related Classes of org.apache.poi.ss.usermodel.StylesSource

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.