/** * Accessor for the cell comment * * @return the cell comment, or NULL if this cell doesn't have * a comment associated with it */ public String getComment() { return super.getComment(); }
/** * Gets the data validation list * * @return the data validation list */ public String getDataValidationList() { return super.getDataValidationList(); }
/** * Gets the range of cells to which the data validation applies. If the * validation applies to just this cell, this will be reflected in the * returned range * * @return the range to which the same validation extends, or NULL if this * cell doesn't have a validation */ public Range getSharedDataValidationRange() { return super.getSharedDataValidationRange(); } }
/** * Use the same data validation logic as the specified cell features * * @param cf the data validation to reuse */ public void shareDataValidation(BaseCellFeatures source) { if (dataValidation) { logger.warn("Attempting to share a data validation on cell " + CellReferenceHelper.getCellReference(writableCell) + " which already has a data validation"); return; } clearValidationSettings(); dvParser = source.getDVParser(); validationSettings = null; dataValidation = true; dropDown = source.dropDown; comboBox = source.comboBox; }
/** * Sets the cell comment * * @param s the comment */ public void setComment(String s) { setComment(s, defaultCommentWidth, defaultCommentHeight); }
/** * Internal function which removes any data validation, including * shared ones, if present. This is called from WritableSheetImpl * in response to a call to removeDataValidation */ public void removeSharedDataValidation() { if (!dataValidation) { return; } // Remove the validation from the WritableSheet object if present writableCell.removeDataValidation(); clearValidationSettings(); }
/** * Gets the range of cells to which the data validation applies. If the * validation applies to just this cell, this will be reflected in the * returned range * * @return the range to which the same validation extends, or NULL if this * cell doesn't have a validation */ public Range getSharedDataValidationRange() { if (!dataValidation) { return null; } DVParser dvp = getDVParser(); return new SheetRangeImpl(writableCell.getSheet(), dvp.getFirstColumn(), dvp.getFirstRow(), dvp.getLastColumn(), dvp.getLastRow()); } }
/** * Use the same data validation logic as the specified cell features * * @param cf the data validation to reuse */ public void shareDataValidation(BaseCellFeatures source) { if (dataValidation) { logger.warn("Attempting to share a data validation on cell " + CellReferenceHelper.getCellReference(writableCell) + " which already has a data validation"); return; } clearValidationSettings(); dvParser = source.getDVParser(); validationSettings = null; dataValidation = true; dropDown = source.dropDown; comboBox = source.comboBox; }
/** * Sets the cell comment * * @param s the comment */ public void setComment(String s) { setComment(s, defaultCommentWidth, defaultCommentHeight); }
/** * Internal function which removes any data validation, including * shared ones, if present. This is called from WritableSheetImpl * in response to a call to removeDataValidation */ public void removeSharedDataValidation() { if (!dataValidation) { return; } // Remove the validation from the WritableSheet object if present writableCell.removeDataValidation(); clearValidationSettings(); }
/** * Gets the range of cells to which the data validation applies. If the * validation applies to just this cell, this will be reflected in the * returned range * * @return the range to which the same validation extends, or NULL if this * cell doesn't have a validation */ public Range getSharedDataValidationRange() { if (!dataValidation) { return null; } DVParser dvp = getDVParser(); return new SheetRangeImpl(writableCell.getSheet(), dvp.getFirstColumn(), dvp.getFirstRow(), dvp.getLastColumn(), dvp.getLastRow()); } }
/** * Sets the data validation based upon a named range */ public void setDataValidationRange(String namedRange) { if (dataValidation && getDVParser().extendedCellsValidation()) { logger.warn("Cannot set data validation on " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of a shared data validation"); return; } clearValidationSettings(); dvParser = new DVParser(namedRange); dropDown = true; dataValidation = true; }
/** * Accessor for the cell comment * * @return the cell comment, or NULL if this cell doesn't have * a comment associated with it */ public String getComment() { return super.getComment(); }
/** * Gets the range of cells to which the data validation applies. If the * validation applies to just this cell, this will be reflected in the * returned range * * @return the range to which the same validation extends, or NULL if this * cell doesn't have a validation */ public Range getSharedDataValidationRange() { return super.getSharedDataValidationRange(); } }
/** * Gets the data validation list * * @return the data validation list */ public String getDataValidationList() { return super.getDataValidationList(); }
/** * The list of items to validate for this cell in the form of a cell range. * * @param c the list of valid values */ public void setDataValidationRange(int col1, int r1, int col2, int r2) { if (dataValidation && getDVParser().extendedCellsValidation()) { logger.warn("Cannot set data validation on " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of a shared data validation"); return; } clearValidationSettings(); dvParser = new DVParser(col1, r1, col2, r2); dropDown = true; dataValidation = true; }
/** * The list of items to validate for this cell in the form of a cell range. * * @param c the list of valid values */ public void setDataValidationRange(int col1, int r1, int col2, int r2) { if (dataValidation && getDVParser().extendedCellsValidation()) { logger.warn("Cannot set data validation on " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of a shared data validation"); return; } clearValidationSettings(); dvParser = new DVParser(col1, r1, col2, r2); dropDown = true; dataValidation = true; }
/** * Sets the data validation based upon a named range */ public void setDataValidationRange(String namedRange) { if (dataValidation && getDVParser().extendedCellsValidation()) { logger.warn("Cannot set data validation on " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of a shared data validation"); return; } clearValidationSettings(); dvParser = new DVParser(namedRange); dropDown = true; dataValidation = true; }
/** * The list of items to validate for this cell. For each object in the * collection, the toString() method will be called and the data entered * will be validated against that string * * @param c the list of valid values */ public void setDataValidationList(Collection c) { if (dataValidation && getDVParser().extendedCellsValidation()) { logger.warn("Cannot set data validation on " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of a shared data validation"); return; } clearValidationSettings(); dvParser = new DVParser(c); dropDown = true; dataValidation = true; }
public void setNumberValidation(double val1, double val2, ValidationCondition c) { if (dataValidation && getDVParser().extendedCellsValidation()) { logger.warn("Cannot set data validation on " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of a shared data validation"); return; } clearValidationSettings(); dvParser = new DVParser(val1, val2, c.getCondition()); dropDown = false; dataValidation = true; }