use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class XWPFRun method setItalic.
/**
* Whether the bold property shall be applied to all non-complex script
* characters in the contents of this run when displayed in a document
* <p/>
* <p/>
* This formatting property is a toggle property, which specifies that its
* behavior differs between its use within a style definition and its use as
* direct formatting. When used as part of a style definition, setting this
* property shall toggle the current state of that property as specified up
* to this point in the hierarchy (i.e. applied to not applied, and vice
* versa). Setting it to <code>false</code> (or an equivalent) shall
* result in the current setting remaining unchanged. However, when used as
* direct formatting, setting this property to true or false shall set the
* absolute state of the resulting property.
* </p>
* <p/>
* If this element is not present, the default value is to leave the
* formatting applied at previous level in the style hierarchy. If this
* element is never applied in the style hierarchy, then bold shall not be
* applied to non-complex script characters.
* </p>
*
* @param value <code>true</code> if the italic property is applied to
* this run
*/
public void setItalic(boolean value) {
CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
CTOnOff italic = pr.isSetI() ? pr.getI() : pr.addNewI();
italic.setVal(value ? STOnOff.TRUE : STOnOff.FALSE);
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class XWPFRun method setCharacterSpacing.
public void setCharacterSpacing(int twips) {
CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
CTSignedTwipsMeasure spc = pr.isSetSpacing() ? pr.getSpacing() : pr.addNewSpacing();
spc.setVal(BigInteger.valueOf(twips));
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class XWPFRun method getColor.
/**
* Get text color. The returned value is a string in the hex form "RRGGBB".
*/
public String getColor() {
String color = null;
if (run.isSetRPr()) {
CTRPr pr = run.getRPr();
if (pr.isSetColor()) {
CTColor clr = pr.getColor();
color = clr.xgetVal().getStringValue();
}
}
return color;
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class XWPFRun method setImprinted.
public void setImprinted(boolean value) {
CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
CTOnOff imprinted = pr.isSetImprint() ? pr.getImprint() : pr.addNewImprint();
imprinted.setVal(value ? STOnOff.TRUE : STOnOff.FALSE);
}
use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr in project poi by apache.
the class XWPFRun method setKerning.
public void setKerning(int kern) {
CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
CTHpsMeasure kernmes = pr.isSetKern() ? pr.getKern() : pr.addNewKern();
kernmes.setVal(BigInteger.valueOf(kern));
}
Aggregations