Example usage for org.apache.poi.ss.util CellRangeAddressList countRanges

List of usage examples for org.apache.poi.ss.util CellRangeAddressList countRanges

Introduction

In this page you can find the example usage for org.apache.poi.ss.util CellRangeAddressList countRanges.

Prototype

public int countRanges() 

Source Link

Document

Get the number of following ADDR structures.

Usage

From source file:com.globalsight.everest.webapp.pagehandler.administration.reports.generator.PostReviewQAReportGenerator.java

License:Apache License

private void addCommentStatusValidation(Sheet p_sheet, DataValidationHelper dvHelper,
        DataValidationConstraint dvConstraint, CellRangeAddressList addressList) {
    if (addressList == null || addressList.countRanges() == 0)
        return;/*from   w  ww.  j  a  va2 s . c om*/

    DataValidation validationOne = dvHelper.createValidation(dvConstraint, addressList);
    validationOne.setSuppressDropDownArrow(true);
    validationOne.setShowErrorBox(true);
    p_sheet.addValidationData(validationOne);
}

From source file:de.jlo.talendcomp.excel.SpreadsheetOutput.java

License:Apache License

private boolean checkIfIsAppendedDataValidationNeccessary(DataValidation originalDv, int lastRowIndex) {
    CellRangeAddressList originalAl = originalDv.getRegions();
    int originalLastDataRow = 0;
    for (int i = 0; i < originalAl.countRanges(); i++) {
        CellRangeAddress cra = originalAl.getCellRangeAddress(i);
        if (cra.getLastRow() > originalLastDataRow) {
            originalLastDataRow = cra.getLastRow();
        }/*from   w  w  w . j a v  a  2s .co  m*/
    }
    return (originalLastDataRow < lastRowIndex);
}