Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Sheet


    final String nm = "row200.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    final SimpleSSDataListener ssl = new SimpleSSDataListener();
    book.addSSDataListener(ssl);

    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    sheet1.deleteColumns(2,2); //delete column C (C1 ~ C100)

    List evts = ssl.getList();
   
    for(Iterator it = evts.iterator(); it.hasNext();) {
      final SSDataEvent ev = (SSDataEvent) it.next();
View Full Code Here


 
  public void testInsertColumnOutOfRange() {
    final String nm = "row200.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
   
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    try {
      sheet1.insertColumns(-1, -1);
      assertFalse("Should come here after sheet1.insertColumns(-1, -1);",true);
    } catch(Exception ex) {
      System.out.println(ex.getMessage());//correct and ignore
    }
  }
View Full Code Here

  public void testDeleteColumnOutOfRange() {
    final String nm = "row200.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
   
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    try {
      sheet1.deleteColumns(-1, -1);
      assertFalse("Should come here after sheet1.deleteColumns(-1, -1);",true);
    } catch(Exception ex) {
      System.out.println(ex.getMessage());//correct and ignore
    }
  }
View Full Code Here

  }
  public void testInsertRowOutOfRange() {
    final String nm = "row200.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
   
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    try {
      sheet1.insertRows(-1, -1);
      assertFalse("Should come here after sheet1.insertRows(-1, -1);",true);
    } catch(Exception ex) {
      System.out.println(ex.getMessage());//correct and ignore
      //correct and ignore
    }
View Full Code Here

  }
  public void testDeleteRowOutOfRange() {
    final String nm = "row200.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
   
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    try {
      sheet1.deleteRows(-1, -1);
      assertFalse("Should come here after sheet1.deleteRows(-1, -1);",true);
    } catch(Exception ex) {
      System.out.println(ex.getMessage());//correct and ignore
      //correct and ignore
    }
View Full Code Here

  }
 
  public void test1990542() {
    final String nm = "B-1991498.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    final SimpleSSDataListener ssl = new SimpleSSDataListener();
    book.addSSDataListener(ssl);
   
    FormatImpl newFormat = new FormatImpl();
    newFormat.setFontColor("green");
    sheet1.getCell(1,2).setFormat( newFormat );
   
    List evts = ssl.getList();
    assertEquals(1, evts.size());
   
    SSDataEvent ev = (SSDataEvent)evts.get(0);
View Full Code Here

  }
 
  public void test1997415() {
    final String nm = "B-1997415.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
   
    String a1str = sheet1.getCell(0, 0).getText(); //a1
    String a2str = sheet1.getCell(1, 0).getText(); //a2
   
    assertEquals("", a1str);
    assertEquals("$256.00", a2str);
   
  }
View Full Code Here

  }
 
  public void test1997417() {
    final String nm = "B-1997417.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    final SimpleSSDataListener ssl = new SimpleSSDataListener();
    book.addSSDataListener(ssl);
   
    sheet1.setCellValue(11, 4, new Integer(10));
   
    List evts = ssl.getList();
    assertEquals(5, evts.size());
  }
View Full Code Here

  }
 
  public void test2002276(){
    final String nm = "B-2002276.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    Iterator iter = sheet1.getImages().iterator();
    Image image = (Image)iter.next();
    assertEquals(1,image.getColumn());
    assertEquals(2,image.getRow());
    assertEquals(0.015625,image.getColumnFraction());
    assertEquals(0.05078125,image.getRowFraction());
View Full Code Here

  }
 
  public void testDeleteColumnsWidth() {
    final String nm = "colwidth.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    int widthA = sheet1.getColumnWidth(0);
    int widthB = sheet1.getColumnWidth(1);
    int widthC = sheet1.getColumnWidth(2);
   
    sheet1.deleteColumns(1,1);
   
    assertEquals(widthA, sheet1.getColumnWidth(0));
    assertTrue(widthB != sheet1.getColumnWidth(1));
    assertEquals(widthC, sheet1.getColumnWidth(1));
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Sheet

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.