use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFDataValidation method getConstraint.
private static XSSFDataValidationConstraint getConstraint(CTDataValidation ctDataValidation) {
String formula1 = ctDataValidation.getFormula1();
String formula2 = ctDataValidation.getFormula2();
Enum operator = ctDataValidation.getOperator();
org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationType.Enum type = ctDataValidation.getType();
Integer validationType = XSSFDataValidation.validationTypeReverseMappings.get(type);
Integer operatorType = XSSFDataValidation.operatorTypeReverseMappings.get(operator);
return new XSSFDataValidationConstraint(validationType, operatorType, formula1, formula2);
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFCellStyle method getBorderLeftEnum.
/**
* Get the type of border to use for the left border of the cell
* Will be removed when {@link #getBorderLeft()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
* @since POI 3.15
*/
@Override
public BorderStyle getBorderLeftEnum() {
if (!_cellXf.getApplyBorder())
return BorderStyle.NONE;
int idx = (int) _cellXf.getBorderId();
CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
STBorderStyle.Enum ptrn = ct.isSetLeft() ? ct.getLeft().getStyle() : null;
if (ptrn == null) {
return BorderStyle.NONE;
}
return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFCellStyle method getBorderBottomEnum.
/**
* Get the type of border to use for the bottom border of the cell
* Will be removed when {@link #getBorderBottom()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
* @since POI 3.15
*/
@Override
public BorderStyle getBorderBottomEnum() {
if (!_cellXf.getApplyBorder())
return BorderStyle.NONE;
int idx = (int) _cellXf.getBorderId();
CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
STBorderStyle.Enum ptrn = ct.isSetBottom() ? ct.getBottom().getStyle() : null;
if (ptrn == null) {
return BorderStyle.NONE;
}
return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFCellStyle method getBorderRightEnum.
/**
* Get the type of border to use for the right border of the cell
* Will be removed when {@link #getBorderRight()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
* @since POI 3.15
*/
@Override
public BorderStyle getBorderRightEnum() {
if (!_cellXf.getApplyBorder())
return BorderStyle.NONE;
int idx = (int) _cellXf.getBorderId();
CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
STBorderStyle.Enum ptrn = ct.isSetRight() ? ct.getRight().getStyle() : null;
if (ptrn == null) {
return BorderStyle.NONE;
}
return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFCellStyle method getBorderTopEnum.
/**
* Get the type of border to use for the top border of the cell
* Will be removed when {@link #getBorderTop()} returns a BorderStyle enum
*
* @return border type, default value is {@link org.apache.poi.ss.usermodel.BorderStyle#NONE}
* @since POI 3.15
*/
@Override
public BorderStyle getBorderTopEnum() {
if (!_cellXf.getApplyBorder())
return BorderStyle.NONE;
int idx = (int) _cellXf.getBorderId();
CTBorder ct = _stylesSource.getBorderAt(idx).getCTBorder();
STBorderStyle.Enum ptrn = ct.isSetTop() ? ct.getTop().getStyle() : null;
if (ptrn == null) {
return BorderStyle.NONE;
}
return BorderStyle.valueOf((short) (ptrn.intValue() - 1));
}
Aggregations