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;
}
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);
}
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());
}
Aggregations