List of usage examples for org.apache.poi.hssf.usermodel HSSFDataValidation setEmptyCellAllowed
public void setEmptyCellAllowed(boolean allowed)
From source file:com.asakusafw.testtools.templategen.ExcelBookBuilder.java
License:Apache License
private void setExplicitListConstraint(HSSFSheet sheet, String[] list, int firstRow, int lastRow, int firstCol, int lastCol) { //????/* ww w. j a va 2s .c o m*/ CellRangeAddressList addressList = new CellRangeAddressList(firstRow, lastRow, firstCol, lastCol); DVConstraint constraint = DVConstraint.createExplicitListConstraint(list); HSSFDataValidation validation = new HSSFDataValidation(addressList, constraint); validation.setEmptyCellAllowed(true); validation.setSuppressDropDownArrow(false); sheet.addValidationData(validation); }