use of org.apache.poi.hssf.record.ExtendedFormatRecord in project poi by apache.
the class InternalWorkbook method getExFormatAt.
/**
* gets the ExtendedFormatRecord at the given 0-based index
*
* @param index of the Extended format record (0-based)
* @return ExtendedFormatRecord at the given index
*/
public ExtendedFormatRecord getExFormatAt(int index) {
int xfptr = records.getXfpos() - (numxfs - 1);
xfptr += index;
ExtendedFormatRecord retval = (ExtendedFormatRecord) records.get(xfptr);
return retval;
}
use of org.apache.poi.hssf.record.ExtendedFormatRecord in project poi by apache.
the class InternalWorkbook method createExtendedFormat.
private static ExtendedFormatRecord createExtendedFormat(int fontIndex, int formatIndex, int cellOptions, int indentionOptions) {
ExtendedFormatRecord retval = new ExtendedFormatRecord();
retval.setFontIndex((short) fontIndex);
retval.setFormatIndex((short) formatIndex);
retval.setCellOptions((short) cellOptions);
retval.setAlignmentOptions((short) 0x20);
retval.setIndentionOptions((short) indentionOptions);
retval.setBorderOptions((short) 0);
retval.setPaletteOptions((short) 0);
retval.setAdtlPaletteOptions((short) 0);
retval.setFillPaletteOptions((short) 0x20c0);
return retval;
}
use of org.apache.poi.hssf.record.ExtendedFormatRecord in project poi by apache.
the class InternalWorkbook method createCellXF.
/**
* creates a new Cell-type Extended Format Record and adds it to the end of
* ExtendedFormatRecords collection
*
* @return ExtendedFormatRecord that was created
*/
public ExtendedFormatRecord createCellXF() {
ExtendedFormatRecord xf = createExtendedFormat();
records.add(records.getXfpos() + 1, xf);
records.setXfpos(records.getXfpos() + 1);
numxfs++;
return xf;
}
use of org.apache.poi.hssf.record.ExtendedFormatRecord in project poi by apache.
the class HSSFSheet method getColumnStyle.
/**
* Returns the HSSFCellStyle that applies to the given
* (0 based) column, or null if no style has been
* set for that column
*/
@Override
public HSSFCellStyle getColumnStyle(int column) {
short styleIndex = _sheet.getXFIndexForColAt((short) column);
if (styleIndex == 0xf) {
// None set
return null;
}
ExtendedFormatRecord xf = _book.getExFormatAt(styleIndex);
return new HSSFCellStyle(styleIndex, xf, _book);
}
use of org.apache.poi.hssf.record.ExtendedFormatRecord in project poi by apache.
the class HSSFRow method getRowStyle.
/**
* Returns the whole-row cell styles. Most rows won't
* have one of these, so will return null. Call
* {@link #isFormatted()} to check first.
*/
@Override
public HSSFCellStyle getRowStyle() {
if (!isFormatted()) {
return null;
}
short styleIndex = row.getXFIndex();
ExtendedFormatRecord xf = book.getWorkbook().getExFormatAt(styleIndex);
return new HSSFCellStyle(styleIndex, xf, book);
}
Aggregations