Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Sheet


     
      return sb.toString();
    }
   
    public String getLeftHeaderOuterAttrs(int row){
      Sheet sheet = getSelectedSheet();
      HeaderPositionHelper rowHelper = Spreadsheet.this.getRowPositionHelper(sheet);
      StringBuffer sb = new StringBuffer();
     
      //class="zsleftcell zsrow zslrh${status.index}"  z.r="${status.index}"
      sb.append("class=\"zsleftcell zsrow");
View Full Code Here


     
      return sb.toString();
    }
   
    public String getLeftHeaderInnerAttrs(int row){
      Sheet sheet = getSelectedSheet();
      HeaderPositionHelper rowHelper = Spreadsheet.this.getRowPositionHelper(sheet);
      StringBuffer sb = new StringBuffer();
     
      sb.append("class=\"zsleftcelltxt ");
      int[] meta = rowHelper.getMeta(row);
View Full Code Here

 
  public void testErrorFormula() {
    Book book = new ExcelImporter().imports(getClass().getResource("/div0.xls"));
    String[] names = book.getNameRangeNames();
    System.out.println("names="+Objects.toString(names));
    Sheet sheet = (Sheet) book.getSheets().get(0);

    //test single column range
    for (int j = 1; j < 8; ++j) { //A1 ~ A7
      Cell cell = sheet.getCell(j-1,0);
      assertEquals(""+j, cell.getText());
    }
    {
      Cell cell = sheet.getCell(7,0); //A8
      assertEquals("#VALUE!", cell.getText());
    }

    //test single row range
    for (int j = 1; j < 7; ++j) { //A9 ~ F9
      Cell cell = sheet.getCell(8, j-1);
      assertEquals(""+(j*10), cell.getText());
    }
    {
      Cell cell = sheet.getCell(8,6); //G9
      assertEquals("#VALUE!", cell.getText());
    }
   
    //test multiple row and column range
    {
      Cell cell = sheet.getCell(11,0); //A12
      assertEquals("#VALUE!", cell.getText());
    }
   
    //test single cell range
    {
      Cell cell = sheet.getCell(12,0); //A13
      assertEquals("100", cell.getText());
    }
  }
View Full Code Here

  }

  public void testWidths() {
    final String nm = "widths.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    int[][] widths = sheet1.getColumnWidths();
    assertEquals(1, widths.length);
    assertEquals(5, widths[0][0]);
  }
View Full Code Here

  }
 
  public void test1919118() {
    final String nm = "B-1919118.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    assertEquals("Marketing Division 3", ((SheetImpl)sheet1).getCell(1, 1).getText());
    assertEquals("05-15743", ((SheetImpl)sheet1).getCell(3, 1).getText());
   
    ((SheetImpl)sheet1).setCellEditText(1, 1, "Marketing Division 3"); //B2
    assertEquals("Marketing Division 3", ((SheetImpl)sheet1).getCell(1, 1).getText());
View Full Code Here

  }
 
  public void test1988691() {
    final String nm = "B-1988691.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    assertEquals("2008", ((SheetImpl)sheet1).getCell(1, 1).getText()); //B2
    assertEquals("1234.5678", ((SheetImpl)sheet1).getCell(3, 1).getText()); //B4

    ((SheetImpl)sheet1).setCellEditText(1, 1, "2008"); //B2
    assertEquals("2008", ((SheetImpl)sheet1).getCell(1, 1).getText());
View Full Code Here

  }
 
  public void test1992587() {
    final String nm = "B-1992587.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 1).getFormat().getFillColor()); //B2
    assertEquals("#008000", ((SheetImpl)sheet1).getCell(5, 1).getFormat().getFillColor()); //B6
 
    //insert two columns
    sheet1.insertColumns(2, 3);
   
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 2).getFormat().getFillColor()); //C2
    assertEquals("#008000", ((SheetImpl)sheet1).getCell(5, 2).getFormat().getFillColor()); //C6
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 3).getFormat().getFillColor()); //D2
    assertEquals("#008000", ((SheetImpl)sheet1).getCell(5, 3).getFormat().getFillColor()); //D6
   
    //insert two rows
    sheet1.insertRows(2, 3);
   
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(2, 1).getFormat().getFillColor()); //B3
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(3, 1).getFormat().getFillColor()); //B4
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(2, 2).getFormat().getFillColor()); //C3
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(3, 2).getFormat().getFillColor()); //C4
View Full Code Here

  }
 
  public void test1991498() {
    final String nm = "B-1991498.xls";
    Book book = new ExcelImporter().imports(getClass().getResource("/"+nm));
    Sheet sheet1 = (Sheet) book.getSheets().get(0);
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 2).getFormat().getFontColor()); //C2
    assertEquals("#ff0000", ((SheetImpl)sheet1).getCell(1, 2).getTextColor()); //C2
   
    final Cell cell = sheet1.getCell(1,2);
    FormatImpl newFormat;
    try {
      newFormat = (FormatImpl) ((FormatImpl) cell.getFormat()).clone();
      newFormat.setFontColor("green");
      cell.setFormat( newFormat );
View Full Code Here

  }
  public boolean isEmpty() {
    return true; //always true
  }
  public String toString() {
    final Sheet sheet = getSheet();
    return "" + System.identityHashCode(this)
    + "/" + (sheet == null ? "null" : sheet.getName())
    + "!" + Indexes.toA1(getTop(), getLeft(), false, false);
  }
View Full Code Here

       * Create sheets and add them to book first.
       * Then you fill in cells inside the sheet.
       */
      for (int i = 0; i < sheets.length; i++) {
        jxl.Sheet jsheet = sheets[i];
        Sheet sh = book.addSheet(jsheet.getName(), jsheet
              .getColumns(), jsheet.getRows());
      }
      /*
       * Named ranges need to be imported before the formula
       */
 
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.