Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Book


        final PtgShifter shifter2007 = new PtgShifter(moveSheetIndex, startRow, endRow, nRow, startCol, endCol, nCol, SpreadsheetVersion.EXCEL2007);
    for (Ref ref : all) {
      final int tRow = ref.getTopRow();
      final int lCol = ref.getLeftCol();
      final Worksheet srcSheet = getSheet(sheet, ref.getOwnerSheet());
      final Book srcBook = (Book) srcSheet.getWorkbook();
      final Cell srcCell = getCell(srcSheet, tRow, lCol);
      if (srcCell != null && srcCell.getCellType() == Cell.CELL_TYPE_FORMULA) {
        final int sheetIndex = srcBook.getSheetIndex(srcSheet);
        if (srcBook.getSpreadsheetVersion() == SpreadsheetVersion.EXCEL97) {
          shiftHSSFFormulas(shifter97, sheetIndex, srcCell);
        } else {
          shiftXSSFFormulas(shifter2007, sheetIndex, (XSSFCell)srcCell, (XSSFWorkbook)srcBook);
        }
      }
View Full Code Here


    if (cell == null) {
      return "";
    }
    int cellType = cell.getCellType();
    if (cellType == Cell.CELL_TYPE_FORMULA) {
      final Book book = (Book)cell.getSheet().getWorkbook();
      final CellValue cv = BookHelper.evaluate(book, cell);
      return BookHelper.getValueByCellValue(cv);
    } else {
      return BookHelper.getCellValue(cell);
    }
View Full Code Here

    }
    return all;
  }
 
  private static Set<Ref> setBordersOutline(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
View Full Code Here

    return all;
  }
 
  private static Set<Ref> setBordersInside(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
View Full Code Here

    all.add(new AreaRefImpl(tRow, lCol, bRow, rCol, refSheet));
    return all;
  }

  private static Set<Ref> setBordersDiagonal(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, short borderIndex, BorderStyle lineStyle, String color) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Color bsColor = BookHelper.HTMLToColor(book, color);
    final short bsLineStyle = getBorderStyleIndex(lineStyle);
    Set<Ref> all = new HashSet<Ref>();
   
View Full Code Here

    all.add(new AreaRefImpl(tRow, lCol, bRow, rCol, refSheet));
    return all;
  }
 
  public static Set<Ref> setColumnWidth(Worksheet sheet, int lCol, int rCol, int char256) {
    final Book book = (Book) sheet.getWorkbook();
    final int maxrow = book.getSpreadsheetVersion().getLastRowIndex();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Set<Ref> all = new HashSet<Ref>();
    for (int col = lCol; col <= rCol; ++col) {
      final int orgChar256 = sheet.getColumnWidth(col);
      if (char256 != orgChar256) {
View Full Code Here

    }
    return all;
  }
 
  public static Set<Ref> setRowHeight(Worksheet sheet, int tRow, int bRow, short twips, boolean customHeight) {
    final Book book = (Book) sheet.getWorkbook();
    final int maxcol = book.getSpreadsheetVersion().getLastColumnIndex();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Set<Ref> all = new HashSet<Ref>();
    for (int row = tRow; row <= bRow; ++row) {
      Row rowobj = sheet.getRow(row);
      final int orgTwips = rowobj == null ? sheet.getDefaultRowHeight() : rowobj.getHeight();
View Full Code Here

        if (row != null) {
          row.setZeroHeight(false);
        }
      }
    }
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Ref ref = new AreaRefImpl(tRow, 0, bRow, book.getSpreadsheetVersion().getLastColumnIndex(), refSheet);
    final Set<Ref> all = new HashSet<Ref>();
    all.add(ref);
    return all;
  }
View Full Code Here

  public static Set<Ref> setColumnsHidden(Worksheet sheet, int lCol, int rCol, boolean hidden) {
    for(int c = lCol; c <= rCol; ++c) {
      sheet.setColumnHidden(c, hidden);
    }
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = BookHelper.getRefSheet(book, sheet);
    final Ref ref = new AreaRefImpl(0, lCol, book.getSpreadsheetVersion().getLastRowIndex(), rCol, refSheet);
    final Set<Ref> all = new HashSet<Ref>();
    all.add(ref);
    return all;
  }
View Full Code Here

 
  private static CellValue getCellValue(Worksheet sheet, int cellType, Object value) {
    if (cellType != -1 && value != null) {
      switch(cellType) {
      case Cell.CELL_TYPE_FORMULA:
        final Book book = sheet.getBook();
        final int sheetIndex = book.getSheetIndex(sheet);
        return BookHelper.evaluateFormula(book, sheetIndex, (String) value);
      case Cell.CELL_TYPE_STRING:
        return new CellValue((String)value); //String
      case Cell.CELL_TYPE_BOOLEAN:
        return CellValue.valueOf(((Boolean)value).booleanValue()); //boolean
View Full Code Here

TOP

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

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.