public String getBasisStyleID() { if (ctStyle.getBasedOn() != null) return ctStyle.getBasedOn().getVal(); else return null; }
/** * get StyleID of the style * * @return styleID StyleID of the style */ public String getStyleId() { return ctStyle.getStyleId(); }
/** * get Type of the Style * * @return ctType */ public STStyleType.Enum getType() { return ctStyle.getType(); }
@Override protected void visitStyle( CTStyle style, boolean defaultStyle ) { String styleId = style.getStyleId(); if ( StringUtils.isNotEmpty( styleId ) ) { String className = getClassName( styleId ); visitStyle( className, style.getPPr(), defaultStyle ); visitStyle( className, style.getRPr(), defaultStyle ); visitStyle( className, style.getTblPr(), defaultStyle ); visitStyle( className, style.getTrPr(), defaultStyle ); visitStyle( className, style.getTcPr(), defaultStyle ); } }
style.setStyleId("FootnoteReference"); style.setType(STStyleType.CHARACTER); style.addNewName().setVal("footnote reference"); style.addNewBasedOn().setVal("DefaultParagraphFont"); style.addNewUiPriority().setVal(new BigInteger("99")); style.addNewSemiHidden(); style.addNewUnhideWhenUsed(); style.addNewRPr().addNewVertAlign().setVal(STVerticalAlignRun.SUPERSCRIPT); style.setType(STStyleType.PARAGRAPH); style.setStyleId("FootnoteText"); style.addNewName().setVal("footnote text"); style.addNewBasedOn().setVal("Normal"); style.addNewLink().setVal("FootnoteTextChar"); style.addNewUiPriority().setVal(new BigInteger("99")); style.addNewSemiHidden(); style.addNewUnhideWhenUsed(); CTRPr rpr = style.addNewRPr(); rpr.addNewSz().setVal(new BigInteger("20")); rpr.addNewSzCs().setVal(new BigInteger("20")); style.setCustomStyle(STOnOff.X_1); style.setStyleId("FootnoteTextChar"); style.setType(STStyleType.CHARACTER); style.addNewName().setVal("Footnote Text Char"); style.addNewBasedOn().setVal("DefaultParagraphFont"); style.addNewLink().setVal("FootnoteText"); style.addNewUiPriority().setVal(new BigInteger("99")); style.addNewSemiHidden();
CTPPr xwpfParagraphProperties = style.getCTStyle().getPPr(); if ( xwpfParagraphProperties != null ) if ( style.getCTStyle().getRPr() != null ) FontInfos fontInfos = processRPR( style.getCTStyle().getRPr() ); paragraphProperties.setFontInfos( fontInfos ); CTTblPrBase xwpfTableProperties = style.getCTStyle().getTblPr(); if ( xwpfTableProperties != null )
public String getClassNames( String styleID ) { if ( StringUtils.isEmpty( styleID ) ) { return null; } StringBuilder classNames = new StringBuilder( getClassName( styleID ) ); CTStyle style = super.getStyle( styleID ); while ( style != null ) { style = super.getStyle( style.getBasedOn() ); if ( style != null ) { classNames.insert( 0, getClassName( style.getStyleId(), true ) ); } } return classNames.toString(); }
for ( CTStyle style : s ) org.openxmlformats.schemas.wordprocessingml.x2006.main.STOnOff.Enum isDefault = style.getDefault(); org.openxmlformats.schemas.wordprocessingml.x2006.main.STStyleType.Enum type = style.getType(); stylesByStyleId.put( style.getStyleId(), style );
private Value getValueFromStyle( CTStyle style, XWPFStylesDocument document ) { if ( style != null ) { Value value = getValue( style.getPPr(), document ); if ( value != null ) { return value; } return getValueFromStyle( style.getBasedOn(), document ); } return null; }
private Value getValueFromStyle( CTStyle style, XWPFStylesDocument document ) { if ( style != null ) { Value value = getValue( style.getRPr(), document ); if ( value != null ) { return value; } return getValueFromStyle( style.getBasedOn(), document ); } return null; }
private Value getValueFromStyle( CTStyle style, XWPFStylesDocument document ) { if ( style != null ) { Value value = getValue( style.getTblPr(), document ); if ( value != null ) { return value; } return getValueFromStyle( style.getBasedOn(), document ); } return null; }
public CTPPr getCTPPr( CTStyle style ) { return style.getPPr(); }
ctStyle.setStyleId(strStyleId); ctStyle.setName(styleName); ctStyle.setUiPriority(indentNumber); ctStyle.setUnhideWhenUsed(onoffnull); ctStyle.setQFormat(onoffnull); ctStyle.setPPr(ppr);
public CTRPr getRPr( CTStyle style ) { return style.getRPr(); }
public CTTblPrBase getTblPr( CTStyle style ) { return style.getTblPr(); }
/** * set styleType * * @param type */ public void setType(STStyleType.Enum type) { ctStyle.setType(type); }
/** * set styleID * * @param styleId */ public void setStyleId(String styleId) { ctStyle.setStyleId(styleId); }
public CTTrPr getTrPr( CTStyle style ) { return style.getTrPr(); }
public CTTcPr getTcPr( CTStyle style ) { return style.getTcPr(); }