Search in sources :

Example 1 with BorderFormatting

use of org.apache.poi.hssf.record.cf.BorderFormatting in project poi by apache.

the class CFRuleBase method readFormatOptions.

protected int readFormatOptions(RecordInputStream in) {
    formatting_options = in.readInt();
    formatting_not_used = in.readShort();
    int len = 6;
    if (containsFontFormattingBlock()) {
        _fontFormatting = new FontFormatting(in);
        len += _fontFormatting.getDataLength();
    }
    if (containsBorderFormattingBlock()) {
        _borderFormatting = new BorderFormatting(in);
        len += _borderFormatting.getDataLength();
    }
    if (containsPatternFormattingBlock()) {
        _patternFormatting = new PatternFormatting(in);
        len += _patternFormatting.getDataLength();
    }
    return len;
}
Also used : PatternFormatting(org.apache.poi.hssf.record.cf.PatternFormatting) BorderFormatting(org.apache.poi.hssf.record.cf.BorderFormatting) FontFormatting(org.apache.poi.hssf.record.cf.FontFormatting)

Example 2 with BorderFormatting

use of org.apache.poi.hssf.record.cf.BorderFormatting in project poi by apache.

the class HSSFConditionalFormattingRule method getBorderFormatting.

private HSSFBorderFormatting getBorderFormatting(boolean create) {
    BorderFormatting borderFormatting = cfRuleRecord.getBorderFormatting();
    if (borderFormatting == null) {
        if (!create)
            return null;
        borderFormatting = new BorderFormatting();
        cfRuleRecord.setBorderFormatting(borderFormatting);
    }
    return new HSSFBorderFormatting(cfRuleRecord, workbook);
}
Also used : BorderFormatting(org.apache.poi.hssf.record.cf.BorderFormatting)

Example 3 with BorderFormatting

use of org.apache.poi.hssf.record.cf.BorderFormatting in project poi by apache.

the class TestCFRuleRecord method testCFRuleBase.

private void testCFRuleBase(CFRuleBase record) {
    FontFormatting fontFormatting = new FontFormatting();
    testFontFormattingAccessors(fontFormatting);
    assertFalse(record.containsFontFormattingBlock());
    record.setFontFormatting(fontFormatting);
    assertTrue(record.containsFontFormattingBlock());
    BorderFormatting borderFormatting = new BorderFormatting();
    testBorderFormattingAccessors(borderFormatting);
    assertFalse(record.containsBorderFormattingBlock());
    record.setBorderFormatting(borderFormatting);
    assertTrue(record.containsBorderFormattingBlock());
    PatternFormatting patternFormatting = new PatternFormatting();
    testPatternFormattingAccessors(patternFormatting);
    assertFalse(record.containsPatternFormattingBlock());
    record.setPatternFormatting(patternFormatting);
    assertTrue(record.containsPatternFormattingBlock());
}
Also used : PatternFormatting(org.apache.poi.hssf.record.cf.PatternFormatting) BorderFormatting(org.apache.poi.hssf.record.cf.BorderFormatting) FontFormatting(org.apache.poi.hssf.record.cf.FontFormatting)

Aggregations

BorderFormatting (org.apache.poi.hssf.record.cf.BorderFormatting)3 FontFormatting (org.apache.poi.hssf.record.cf.FontFormatting)2 PatternFormatting (org.apache.poi.hssf.record.cf.PatternFormatting)2