All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.vladsch.flexmark.docx.converter.util.AttributeBlockFormatProvider Maven / Gradle / Ivy

package com.vladsch.flexmark.docx.converter.util;

import org.docx4j.wml.CTShd;
import org.docx4j.wml.PPr;

public class AttributeBlockFormatProvider extends BlockFormatProviderBase {
    final public AttributeFormat myAttributeFormat;

    public AttributeBlockFormatProvider(DocxContext docx, String fontFamily, String fontSize, String fontWeight, String fontStyle, String textColor, String fillColor) {
        super(docx, null);
        myAttributeFormat = new AttributeFormat(fontFamily, fontSize, fontWeight, fontStyle, textColor, fillColor);
    }

    public AttributeBlockFormatProvider(DocxContext docx, AttributeFormat attributeFormat) {
        super(docx, null);
        myAttributeFormat = attributeFormat;
    }

    @Override
    public void open() {
        super.close();
    }

    @Override
    public void close() {
        super.close();
    }

    @Override
    public void adjustPPrForFormatting(PPr pPr) {
        CTShd shd = myAttributeFormat.getShd(myDocx);
        pPr.setShd(shd);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy