/** * 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(); }
/** * 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(); }
/** * 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; }
/** * 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 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 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; }
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; }
/** * 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; }
/** * 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; }
/** * Sets the data validation based upon a numerical condition */ public void setNumberValidation(double val, 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(val, Double.NaN, c.getCondition()); dropDown = false; dataValidation = true; }
/** * Sets the data validation based upon a numerical condition */ public void setNumberValidation(double val, 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(val, Double.NaN, c.getCondition()); dropDown = false; dataValidation = true; }
/** * Public function which removes any data validation, if present */ public void removeDataValidation() { if (!dataValidation) { return; } // If the data validation is shared, then generate a warning DVParser dvp = getDVParser(); if (dvp.extendedCellsValidation()) { logger.warn("Cannot remove data validation from " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of the shared reference " + CellReferenceHelper.getCellReference(dvp.getFirstColumn(), dvp.getFirstRow()) + "-" + CellReferenceHelper.getCellReference(dvp.getLastColumn(), dvp.getLastRow())); return; } // Remove the validation from the WritableSheet object if present writableCell.removeDataValidation(); clearValidationSettings(); }
/** * Public function which removes any data validation, if present */ public void removeDataValidation() { if (!dataValidation) { return; } // If the data validation is shared, then generate a warning DVParser dvp = getDVParser(); if (dvp.extendedCellsValidation()) { logger.warn("Cannot remove data validation from " + CellReferenceHelper.getCellReference(writableCell) + " as it is part of the shared reference " + CellReferenceHelper.getCellReference(dvp.getFirstColumn(), dvp.getFirstRow()) + "-" + CellReferenceHelper.getCellReference(dvp.getLastColumn(), dvp.getLastRow())); return; } // Remove the validation from the WritableSheet object if present writableCell.removeDataValidation(); clearValidationSettings(); }