Package org.zkoss.poi.ss.usermodel

Examples of org.zkoss.poi.ss.usermodel.Workbook


      public void handle(CellVisitorContext context) {
        Font srcFont = context.getFont();
        boolean srcStrikeout = srcFont.getStrikeout();
       
        if (srcStrikeout != isStrikeout) {
          final Workbook book = sheet.getWorkbook();
          Font newFont = context.getOrCreateFont(srcFont.getBoldweight(),
              BookHelper.getFontColor(book, srcFont), srcFont.getFontHeight(), srcFont.getFontName(),
              srcFont.getItalic(), isStrikeout, srcFont.getTypeOffset(), srcFont.getUnderline());
          CellStyle cellStyle = context.cloneCellStyle();
          cellStyle.setFont(newFont);
View Full Code Here


  @Test
  public void testImportsFromXlsInputStream() {
    final String filename = "Book1.xls";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    Workbook wb = new ExcelImporter().imports(is, filename);
    assertTrue(wb instanceof Book);
    assertTrue(wb instanceof HSSFBookImpl);
    assertTrue(wb instanceof HSSFWorkbook);
    assertEquals(filename, ((Book)wb).getBookName());
    assertEquals("Sheet 1", wb.getSheetName(0));
    assertEquals("Sheet2", wb.getSheetName(1));
    assertEquals("Sheet3", wb.getSheetName(2));
    assertEquals(0, wb.getSheetIndex("Sheet 1"));
    assertEquals(1, wb.getSheetIndex("Sheet2"));
    assertEquals(2, wb.getSheetIndex("Sheet3"));
  }
View Full Code Here

 
  @Test
  public void testImportsFromXlsxInputStream() {
    final String filename = "Book1.xlsx";
    final InputStream is = new ClassLocator().getResourceAsStream(filename);
    Workbook wb = new ExcelImporter().imports(is, filename);
    assertTrue(wb instanceof Book);
    assertTrue(wb instanceof XSSFBookImpl);
    assertTrue(wb instanceof XSSFWorkbook);
    assertEquals(filename, ((Book)wb).getBookName());
    assertEquals("Sheet 1", wb.getSheetName(0));
    assertEquals("Sheet2", wb.getSheetName(1));
    assertEquals("Sheet3", wb.getSheetName(2));
    assertEquals(0, wb.getSheetIndex("Sheet 1"));
    assertEquals(1, wb.getSheetIndex("Sheet2"));
    assertEquals(2, wb.getSheetIndex("Sheet3"));
  }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.ss.usermodel.Workbook

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.