Search in sources :

Example 1 with ExtendedFormatRecord

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;
}
Also used : ExtendedFormatRecord(org.apache.poi.hssf.record.ExtendedFormatRecord)

Example 2 with ExtendedFormatRecord

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;
}
Also used : ExtendedFormatRecord(org.apache.poi.hssf.record.ExtendedFormatRecord)

Example 3 with ExtendedFormatRecord

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;
}
Also used : ExtendedFormatRecord(org.apache.poi.hssf.record.ExtendedFormatRecord)

Example 4 with ExtendedFormatRecord

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);
}
Also used : ExtendedFormatRecord(org.apache.poi.hssf.record.ExtendedFormatRecord)

Example 5 with ExtendedFormatRecord

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);
}
Also used : ExtendedFormatRecord(org.apache.poi.hssf.record.ExtendedFormatRecord)

Aggregations

ExtendedFormatRecord (org.apache.poi.hssf.record.ExtendedFormatRecord)13 FontRecord (org.apache.poi.hssf.record.FontRecord)2 FormatRecord (org.apache.poi.hssf.record.FormatRecord)2 HashSet (java.util.HashSet)1 EscherBSERecord (org.apache.poi.ddf.EscherBSERecord)1 EscherContainerRecord (org.apache.poi.ddf.EscherContainerRecord)1 EscherDgRecord (org.apache.poi.ddf.EscherDgRecord)1 EscherDggRecord (org.apache.poi.ddf.EscherDggRecord)1 EscherOptRecord (org.apache.poi.ddf.EscherOptRecord)1 EscherRecord (org.apache.poi.ddf.EscherRecord)1 EscherSpRecord (org.apache.poi.ddf.EscherSpRecord)1 EscherSplitMenuColorsRecord (org.apache.poi.ddf.EscherSplitMenuColorsRecord)1 InternalWorkbook (org.apache.poi.hssf.model.InternalWorkbook)1 BOFRecord (org.apache.poi.hssf.record.BOFRecord)1 BackupRecord (org.apache.poi.hssf.record.BackupRecord)1 BookBoolRecord (org.apache.poi.hssf.record.BookBoolRecord)1 BoundSheetRecord (org.apache.poi.hssf.record.BoundSheetRecord)1 CodepageRecord (org.apache.poi.hssf.record.CodepageRecord)1 CountryRecord (org.apache.poi.hssf.record.CountryRecord)1 DSFRecord (org.apache.poi.hssf.record.DSFRecord)1