List of usage examples for org.apache.poi.hssf.usermodel HSSFSheetConditionalFormatting getConditionalFormattingAt
public HSSFConditionalFormatting getConditionalFormattingAt(int index)
From source file:cn.trymore.core.util.excel.PoiExcelParser.java
License:Open Source License
private Boolean isCellInConditionalFormat(HSSFSheetConditionalFormatting cfms, HSSFCell cell) { if ((cell != null) && (cfms != null)) { int rowIdx = cell.getRowIndex(); int columnIdx = cell.getColumnIndex(); if (cfms.getNumConditionalFormattings() > 0) { int i = 0; for (int len = cfms.getNumConditionalFormattings(); i < len; ++i) { if (cfms.getConditionalFormattingAt(i).getNumberOfRules() <= 0) { continue; }/* www .ja v a 2s. c o m*/ for (int k = 0; k < cfms.getConditionalFormattingAt(i).getFormattingRanges().length; ++k) { if (!(cfms.getConditionalFormattingAt(i).getFormattingRanges()[k].isInRange(rowIdx, columnIdx))) { continue; } for (int j = 0, size = cfms.getConditionalFormattingAt(i) .getNumberOfRules(); j < size; ++j) { HSSFConditionalFormattingRule rule = cfms.getConditionalFormattingAt(i).getRule(j); handleContionalFormatCell(rule, cell); } return Boolean.valueOf(true); } } } } return Boolean.valueOf(false); }