use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFDataValidationConstraint method prettyPrint.
public String prettyPrint() {
StringBuilder builder = new StringBuilder();
STDataValidationType.Enum vt = XSSFDataValidation.validationTypeMappings.get(validationType);
Enum ot = XSSFDataValidation.operatorTypeMappings.get(operator);
builder.append(vt);
builder.append(' ');
if (validationType != ValidationType.ANY) {
if (validationType != ValidationType.LIST && validationType != ValidationType.FORMULA) {
builder.append(LIST_SEPARATOR).append(ot).append(", ");
}
final String NOQUOTE = "";
if (validationType == ValidationType.LIST && explicitListOfValues != null) {
builder.append(NOQUOTE).append(Arrays.asList(explicitListOfValues)).append(NOQUOTE).append(' ');
} else {
builder.append(NOQUOTE).append(formula1).append(NOQUOTE).append(' ');
}
if (formula2 != null) {
builder.append(NOQUOTE).append(formula2).append(NOQUOTE).append(' ');
}
}
return builder.toString();
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFFont method setUnderline.
/**
* set an enumeration representing the style of underlining that is used.
* The none style is equivalent to not using underlining at all.
* The possible values for this attribute are defined by the FontUnderline
*
* @param underline - FontUnderline enum value
*/
public void setUnderline(FontUnderline underline) {
if (underline == FontUnderline.NONE && _ctFont.sizeOfUArray() > 0) {
_ctFont.setUArray(null);
} else {
CTUnderlineProperty ctUnderline = _ctFont.sizeOfUArray() == 0 ? _ctFont.addNewU() : _ctFont.getUArray(0);
STUnderlineValues.Enum val = STUnderlineValues.Enum.forInt(underline.getValue());
ctUnderline.setVal(val);
}
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFFont method setScheme.
/**
* set font scheme property
*
* @param scheme - FontScheme enum value
* @see FontScheme
*/
public void setScheme(FontScheme scheme) {
CTFontScheme ctFontScheme = _ctFont.sizeOfSchemeArray() == 0 ? _ctFont.addNewScheme() : _ctFont.getSchemeArray(0);
STFontScheme.Enum val = STFontScheme.Enum.forInt(scheme.getValue());
ctFontScheme.setVal(val);
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class XSSFSingleXmlCell method getXmlDataType.
public Enum getXmlDataType() {
CTXmlCellPr xmlCellPr = singleXmlCell.getXmlCellPr();
CTXmlPr xmlPr = xmlCellPr.getXmlPr();
return xmlPr.getXmlDataType();
}
use of org.openxmlformats.schemas.spreadsheetml.x2006.main.STDataValidationOperator.Enum in project poi by apache.
the class TestXSSFCellStyle method testGetSetBorderNone.
// Border Styles, in BorderStyle/STBorderStyle enum order
@Test
public void testGetSetBorderNone() {
cellStyle.setBorderTop(BorderStyle.NONE);
assertEquals(BorderStyle.NONE, cellStyle.getBorderTopEnum());
int borderId = (int) cellStyle.getCoreXf().getBorderId();
assertTrue(borderId > 0);
//check changes in the underlying xml bean
CTBorder ctBorder = stylesTable.getBorderAt(borderId).getCTBorder();
assertNull(ctBorder.getTop());
// no border style and STBorderStyle.NONE are equivalent
// POI prefers to unset the border style than explicitly set it STBorderStyle.NONE
}
Aggregations