本文整理汇总了Java中org.apache.poi.ss.util.CellRangeAddressList.addCellRangeAddress方法的典型用法代码示例。如果您正苦于以下问题:Java CellRangeAddressList.addCellRangeAddress方法的具体用法?Java CellRangeAddressList.addCellRangeAddress怎么用?Java CellRangeAddressList.addCellRangeAddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.poi.ss.util.CellRangeAddressList
的用法示例。
在下文中一共展示了CellRangeAddressList.addCellRangeAddress方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: InputRule
import org.apache.poi.ss.util.CellRangeAddressList; //导入方法依赖的package包/类
private InputRule(Sheet sheet, Element el) {
empty = "1".equals(el.getAttribute("allowBlank"));
if ("1".equals(el.getAttribute("showErrorMessage"))) {
errTitle = checkNull(el.getAttribute("errorTitle"));
errText = checkNull(el.getAttribute("error"));
//errStyle = ???
}
if ("1".equals(el.getAttribute("showInputMessage"))) {
pmTitle = checkNull(el.getAttribute("promptTitle"));
pmText = checkNull(el.getAttribute("prompt"));
}
String region = null;
Node node = el.getFirstChild();
while (node != null) {
String name = node.getLocalName();
if ("formula1".equals(name)) {
f1 = getChildText((Element)node);
} else if ("formula2".equals(name)) {
f2 = getChildText((Element)node);
} else if ("sqref".equals(name)) {
region = getChildText((Element)node);
}
node = node.getNextSibling();
}
if (f1 == null || region == null) {
throw new IllegalArgumentException("Invalid element: " + el.getNodeName());
}
regionsStr = new String[1];
regionsStr[0] = region;
regions = new CellRangeAddressList();
regions.addCellRangeAddress(CellRangeAddress.valueOf(region));
//op = ???
vt = DataValidationConstraint.ValidationType.LIST;
list = buildList(sheet, f1);
}
示例2: setupRegions
import org.apache.poi.ss.util.CellRangeAddressList; //导入方法依赖的package包/类
private static void setupRegions(InputRule rule) {
CellRangeAddressList list = new CellRangeAddressList();
for (String str : rule.regionsStr) {
list.addCellRangeAddress(CellRangeAddress.valueOf(str));
}
rule.regions = list;
}