/** * Called when the cell is added to the worksheet in order to indicate * that this object is already added to the worksheet * This method also verifies that the associated formats and formats * have been initialized correctly * * @param fr the formatting records * @param ss the shared strings used within the workbook * @param s the sheet this is being added to */ void setCellDetails(FormattingRecords fr, SharedStrings ss, WritableSheetImpl s) { referenced = true; sheet = s; formattingRecords = fr; addCellFormat(); addCellFeatures(); }
/** * Decrements the row of this cell by one. Invoked by the sheet when * removing rows */ void decrementRow() { rowNumber--; for (int i = 0; i < cells.length; i++) { if (cells[i] != null) { cells[i].decrementRow(); } } }
/** * Removes the data validation for the specified cell. Called from * CellValue in response to a cell being replaced * * @param cv the cell being removed */ void removeDataValidation(CellValue cv) { if (dataValidation != null) { dataValidation.removeDataValidation(cv.getColumn(), cv.getRow()); } if (validatedCells != null) { boolean result = validatedCells.remove(cv); if (!result) { logger.warn("Could not remove validated cell " + CellReferenceHelper.getCellReference(cv)); } } }
if (cv.isReferenced()) RowRecord rowrec = getRowRecord(row); CellValue curcell = rowrec.getCell(cv.getColumn()); boolean curSharedValidation = (curcell != null && curcell.getCellFeatures() != null && curcell.getCellFeatures().getDVParser() != null && curcell.getCellFeatures().getDVParser().extendedCellsValidation()); curSharedValidation) DVParser dvp = curcell.getCellFeatures().getDVParser(); logger.warn("Cannot add cell at " + CellReferenceHelper.getCellReference(cv) + wcf.shareDataValidation(curcell.getCellFeatures()); cv.setCellDetails(formatRecords, sharedStrings, this);
int col = cv.getColumn(); CellReferenceHelper.getCellReference(cv.getRow(), cv.getColumn()) + " because it exceeds the maximum column limit"); return; WritableCellFeatures wcf = cells[col].getWritableCellFeatures(); if (wcf != null)
CellFeatures cf = cv.getCellFeatures(); if (cv.getColumn() == cf.getDVParser().getFirstColumn() && cv.getRow() == cf.getDVParser().getFirstRow())
protected final byte[] getCellData() { return super.getData(); }
Assert.verify(cv.getCellFeatures() != null); cv.getWritableCellFeatures().setCommentDrawing(c);
if (cells[i].getType() == CellType.NUMBER) if (cells[i].getType() == CellType.STRING_FORMULA) StringRecord sr = new StringRecord(cells[i].getContents()); outputFile.write(sr);
CellFeatures cf = cv.getCellFeatures(); if (cf.getDVParser() != null)
/** * An API function which sets the format to apply to this cell * * @param cf the format to apply to this cell */ public void setCellFormat(CellFormat cf) { format = (XFRecord) cf; // If the referenced flag has not been set, this cell has not // been added to the spreadsheet, so we don't need to perform // any further logic if (!referenced) { return; } // The cell has already been added to the spreadsheet, so the // formattingRecords reference must be initialized Assert.verify(formattingRecords != null); addCellFormat(); }
/** * Called when a column is inserted on the specified sheet. Notifies all * RCIR cells of this change * * @param s the sheet on which the column was inserted * @param col the column number which was inserted */ void columnInserted(WritableSheetImpl s, int col) { int externalSheetIndex = getExternalSheetIndex(s.getName()); for (Iterator i = rcirCells.iterator() ; i.hasNext() ;) { CellValue cv = (CellValue) i.next(); cv.columnInserted(s, externalSheetIndex, col); } // Adjust any named cells if (names != null) { for (Iterator i = names.iterator(); i.hasNext() ;) { NameRecord nameRecord = (NameRecord) i.next(); nameRecord.columnInserted(externalSheetIndex, col); } } }
cv.columnRemoved(s, externalSheetIndex, col);
if (cv.isReferenced()) RowRecord rowrec = getRowRecord(row); CellValue curcell = rowrec.getCell(cv.getColumn()); boolean curSharedValidation = (curcell != null && curcell.getCellFeatures() != null && curcell.getCellFeatures().getDVParser() != null && curcell.getCellFeatures().getDVParser().extendedCellsValidation()); curSharedValidation) DVParser dvp = curcell.getCellFeatures().getDVParser(); logger.warn("Cannot add cell at " + CellReferenceHelper.getCellReference(cv) + wcf.shareDataValidation(curcell.getCellFeatures()); cv.setCellDetails(formatRecords, sharedStrings, this);
int col = cv.getColumn(); CellReferenceHelper.getCellReference(cv.getRow(), cv.getColumn()) + " because it exceeds the maximum column limit"); return; WritableCellFeatures wcf = cells[col].getWritableCellFeatures(); if (wcf != null)
CellFeatures cf = cv.getCellFeatures(); if (cv.getColumn() == cf.getDVParser().getFirstColumn() && cv.getRow() == cf.getDVParser().getFirstRow())
protected final byte[] getCellData() { return super.getData(); }
/** * Removes the data validation for the specified cell. Called from * CellValue in response to a cell being replaced * * @param cv the cell being removed */ void removeDataValidation(CellValue cv) { if (dataValidation != null) { dataValidation.removeDataValidation(cv.getColumn(), cv.getRow()); } if (validatedCells != null) { boolean result = validatedCells.remove(cv); if (!result) { logger.warn("Could not remove validated cell " + CellReferenceHelper.getCellReference(cv)); } } }