if (r instanceof DVRecord) {
final DVRecord dvRecord = (DVRecord) r;
final CellRangeAddressList regions = dvRecord.getCellRangeAddress();
final DataValidationConstraint constraint = createContraint(dvRecord);
if (constraint != null) {
HSSFDataValidation dataValidation = new HSSFDataValidation(regions, constraint);
final boolean allowed = dvRecord.getEmptyCellAllowed();
final int errStyle = dvRecord.getErrorStyle();
final boolean showErr = dvRecord.getShowErrorOnInvalidValue();
final boolean showPrompt = dvRecord.getShowPromptOnCellSelected();
final boolean suppress = dvRecord.getSuppressDropdownArrow();
final String promptTitle = dvRecord.getPromptTitle();
final String promptText = dvRecord.getPromptText();
final String errorTitle = dvRecord.getErrorTitle();
final String errorText = dvRecord.getErrorText();
if (showPrompt) {
dataValidation.createPromptBox(promptTitle, promptText);
}
if (showErr) {
dataValidation.createErrorBox(errorTitle, errorText);
}
dataValidation.setEmptyCellAllowed(allowed);
dataValidation.setErrorStyle(errStyle);
dataValidation.setShowErrorBox(showErr);
dataValidation.setShowPromptBox(showPrompt);
dataValidation.setSuppressDropDownArrow(suppress);
_dataValidations.add(dataValidation);
}
}
}