/** * Create child element {@odf.element style:header-style}. * * @return the element {@odf.element style:header-style} */ public StyleHeaderStyleElement newStyleHeaderStyleElement() { StyleHeaderStyleElement styleHeaderStyle = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleHeaderStyleElement.class); this.appendChild(styleHeaderStyle); return styleHeaderStyle; }
/** * Receives the value of the ODFDOM attribute representation <code>StylePageUsageAttribute</code> , See {@odf.attribute style:page-usage} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getStylePageUsageAttribute() { StylePageUsageAttribute attr = (StylePageUsageAttribute) getOdfAttribute(OdfDocumentNamespace.STYLE, "page-usage"); if (attr != null) { return String.valueOf(attr.getValue()); } return StylePageUsageAttribute.DEFAULT_VALUE; }
/** * Sets the value of ODFDOM attribute representation <code>StyleNameAttribute</code> , See {@odf.attribute style:name} * * @param styleNameValue The type is <code>String</code> */ public void setStyleNameAttribute(String styleNameValue) { StyleNameAttribute attr = new StyleNameAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(styleNameValue); }
@Override public void visit( StyleHeaderStyleElement ele ) { StylePageLayoutElement stylePageLayout = (StylePageLayoutElement) ele.getParentNode(); if ( generateCSSComments ) { cssStyleSheet.setComment( "style:page-layout/style:header-style @style:page-layout-name=" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " begin" ); } cssStyleSheet.startCSSStyleDeclaration( computeCSSClassName( stylePageLayout, STYLE_NAME_HEADER ) ); super.visit( ele ); cssStyleSheet.endCSSStyleDeclaration(); if ( generateCSSComments ) { cssStyleSheet.setComment( "style:page-layout/style:header-style @style:page-layout-name" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " end" ); } }
private String compute(OdfStyleBase style, StringBuilder classNames, boolean first, String prefix) { if (style == null) { return null; } String familyName = style.getFamilyName(); String styleName = null; if (style instanceof StyleStyleElement) { styleName = ((StyleStyleElement) style).getStyleNameAttribute(); } else if (style instanceof StylePageLayoutElement) { styleName = ((StylePageLayoutElement) style) .getStyleNameAttribute(); } String className = getClassName(familyName, styleName); if (prefix != null) { className = className + prefix; } if (first) { classNames.append(className); } else { classNames.insert(0, ' '); classNames.insert(0, className); } style = style.getParentStyle(); if (style != null) { compute(style, classNames, false, prefix); } return className; }
/** * Create child element {@odf.element style:page-layout}. * * @param styleNameValue the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute style:name} at specification * @return the element {@odf.element style:page-layout} */ public StylePageLayoutElement newStylePageLayoutElement(String styleNameValue) { StylePageLayoutElement stylePageLayout = ((OdfFileDom) this.ownerDocument).newOdfElement(StylePageLayoutElement.class); stylePageLayout.setStyleNameAttribute(styleNameValue); this.appendChild(stylePageLayout); return stylePageLayout; }
@Override public void visit( StyleFooterStyleElement ele ) { StylePageLayoutElement stylePageLayout = (StylePageLayoutElement) ele.getParentNode(); if ( generateCSSComments ) { cssStyleSheet.setComment( "style:page-layout/style:footer-style @style:page-layout-name=" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " begin" ); } cssStyleSheet.startCSSStyleDeclaration( computeCSSClassName( stylePageLayout, STYLE_NAME_FOOTER ) ); super.visit( ele ); cssStyleSheet.endCSSStyleDeclaration(); if ( generateCSSComments ) { cssStyleSheet.setComment( "style:page-layout/style:footer-style @style:page-layout-name" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " end" ); } }
styleName = ( (StylePageLayoutElement) style ).getStyleNameAttribute();
/** * Create child element {@odf.element style:page-layout}. * * @param styleNameValue the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute style:name} at specification * @return the element {@odf.element style:page-layout} */ public StylePageLayoutElement newStylePageLayoutElement(String styleNameValue) { StylePageLayoutElement stylePageLayout = ((OdfFileDom) this.ownerDocument).newOdfElement(StylePageLayoutElement.class); stylePageLayout.setStyleNameAttribute(styleNameValue); this.appendChild(stylePageLayout); return stylePageLayout; }
@Override public void visit(StyleHeaderStyleElement ele) { StylePageLayoutElement stylePageLayout = (StylePageLayoutElement) ele .getParentNode(); if (generateCSSComments) { cssStyleSheet .setComment("style:page-layout/style:header-style @style:page-layout-name=" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " begin"); } cssStyleSheet.startCSSStyleDeclaration(computeCSSClassName( stylePageLayout, STYLE_NAME_HEADER)); super.visit(ele); cssStyleSheet.endCSSStyleDeclaration(); if (generateCSSComments) { cssStyleSheet .setComment("style:page-layout/style:header-style @style:page-layout-name" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " end"); } }
} else if (styleBase instanceof StylePageLayoutElement) { styleName = ((StylePageLayoutElement) styleBase) .getStyleNameAttribute();
/** * Create child element {@odf.element style:header-style}. * * @return the element {@odf.element style:header-style} */ public StyleHeaderStyleElement newStyleHeaderStyleElement() { StyleHeaderStyleElement styleHeaderStyle = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleHeaderStyleElement.class); this.appendChild(styleHeaderStyle); return styleHeaderStyle; }
/** * Sets the value of ODFDOM attribute representation <code>StyleNameAttribute</code> , See {@odf.attribute style:name} * * @param styleNameValue The type is <code>String</code> */ public void setStyleNameAttribute(String styleNameValue) { StyleNameAttribute attr = new StyleNameAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(styleNameValue); }
/** * Receives the value of the ODFDOM attribute representation <code>StylePageUsageAttribute</code> , See {@odf.attribute style:page-usage} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getStylePageUsageAttribute() { StylePageUsageAttribute attr = (StylePageUsageAttribute) getOdfAttribute(OdfDocumentNamespace.STYLE, "page-usage"); if (attr != null) { return String.valueOf(attr.getValue()); } return StylePageUsageAttribute.DEFAULT_VALUE; }
/** * Create child element {@odf.element style:page-layout}. * * @param styleNameValue the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute style:name} at specification * @return the element {@odf.element style:page-layout} */ public StylePageLayoutElement newStylePageLayoutElement(String styleNameValue) { StylePageLayoutElement stylePageLayout = ((OdfFileDom) this.ownerDocument).newOdfElement(StylePageLayoutElement.class); stylePageLayout.setStyleNameAttribute(styleNameValue); this.appendChild(stylePageLayout); return stylePageLayout; }
@Override public void visit(StyleFooterStyleElement ele) { StylePageLayoutElement stylePageLayout = (StylePageLayoutElement) ele .getParentNode(); if (generateCSSComments) { cssStyleSheet .setComment("style:page-layout/style:footer-style @style:page-layout-name=" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " begin"); } cssStyleSheet.startCSSStyleDeclaration(computeCSSClassName( stylePageLayout, STYLE_NAME_FOOTER)); super.visit(ele); cssStyleSheet.endCSSStyleDeclaration(); if (generateCSSComments) { cssStyleSheet .setComment("style:page-layout/style:footer-style @style:page-layout-name" + stylePageLayout.getStyleNameAttribute() + ", @style:family=" + stylePageLayout.getFamilyName() + " end"); } }
styleName = ( (StylePageLayoutElement) styleBase ).getStyleNameAttribute();
/** * Create child element {@odf.element style:footer-style}. * * @return the element {@odf.element style:footer-style} */ public StyleFooterStyleElement newStyleFooterStyleElement() { StyleFooterStyleElement styleFooterStyle = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleFooterStyleElement.class); this.appendChild(styleFooterStyle); return styleFooterStyle; }
/** * Sets the value of ODFDOM attribute representation <code>StylePageUsageAttribute</code> , See {@odf.attribute style:page-usage} * * @param stylePageUsageValue The type is <code>String</code> */ public void setStylePageUsageAttribute(String stylePageUsageValue) { StylePageUsageAttribute attr = new StylePageUsageAttribute((OdfFileDom) this.ownerDocument); setOdfAttribute(attr); attr.setValue(stylePageUsageValue); }
/** * Receives the value of the ODFDOM attribute representation <code>StylePageUsageAttribute</code> , See {@odf.attribute style:page-usage} * * @return - the <code>String</code> , the value or <code>null</code>, if the attribute is not set and no default value defined. */ public String getStylePageUsageAttribute() { StylePageUsageAttribute attr = (StylePageUsageAttribute) getOdfAttribute(OdfDocumentNamespace.STYLE, "page-usage"); if (attr != null) { return String.valueOf(attr.getValue()); } return StylePageUsageAttribute.DEFAULT_VALUE; }