Example usage for org.apache.poi.hssf.usermodel HSSFDataValidation setEmptyCellAllowed

List of usage examples for org.apache.poi.hssf.usermodel HSSFDataValidation setEmptyCellAllowed

Introduction

In this page you can find the example usage for org.apache.poi.hssf.usermodel HSSFDataValidation setEmptyCellAllowed.

Prototype

public void setEmptyCellAllowed(boolean allowed) 

Source Link

Usage

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);
}