@Override public String getMceIgnorable() { return this.getJaxbElement().getIgnorable(); }
/** * @param id * @return * @since 3.0.0 */ public Style getStyleById(String id) { return getStyleById( this.getJaxbElement().getStyle(), id ); }
@Override protected void setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper) { // NB if you add ignorable content, it is up to you to jaxbElement.setIgnorable correctly; see further McIgnorableNamespaceDeclarator // You don't need to worry about this if you are merely loading an existing part. namespacePrefixMapper.setMcIgnorable( this.getJaxbElement().getIgnorable() ); }
/** * Refresh the style name - ID bimaps, based on styles currently defined in this part. * @since 3.3.0 */ public void refreshNameIdBiMaps() { styleIdToName= HashBiMap.create(); for (Style s : this.getJaxbElement().getStyle()) { if (s.getName()==null || s.getName().getVal()==null) { log.info("style has no name!"); } else if (s.getStyleId()==null || s.getStyleId().trim().length()==0) { log.info("style has no id!"); } else { styleIdToName.put(s.getStyleId(), s.getName().getVal()); } } styleNameToId = styleIdToName.inverse(); }
public Style getDefaultCharacterStyle() { if (defaultCharacterStyle==null) { defaultCharacterStyle = getDefaultStyle("character"); } // OpenOffice conversion to docx // doesn't necessarily contain a default character style // so manufacture one if (defaultCharacterStyle==null) { try { defaultCharacterStyle = (Style)XmlUtils.unmarshalString(DEFAULT_CHARACTER_STYLE_DEFAULT); this.getJaxbElement().getStyle().add(defaultCharacterStyle); } catch (JAXBException e) { e.printStackTrace(); } } return defaultCharacterStyle; }
private Style getDefaultStyle(String type) { for ( org.docx4j.wml.Style s : this.getJaxbElement().getStyle() ) { if( s.isDefault() && s.getType().equals(type)) { log.debug("Style with name " + s.getName().getVal() + ", id '" + s.getStyleId() + "' is default " + s.getType() + " style"); return s; } } return null; }
Styles styles = wmlPackage.getMainDocumentPart().getStyleDefinitionsPart(false).getJaxbElement(); for ( org.docx4j.wml.Style s : styles.getStyle() ) { allStyles.put(s.getStyleId(), s);
Styles styles = getStyleDefinitionsPart().getJaxbElement(); for ( org.docx4j.wml.Style s : styles.getStyle() ) { allStyles.put(s.getStyleId(), s); getStyleDefinitionsPart().getJaxbElement().getDocDefaults(), getStyleDefinitionsPart().getDefaultParagraphStyle());
private TocStyles getTocStyles(MainDocumentPart documentPart) throws TocException { // Styles styles = null; if (documentPart.getStyleDefinitionsPart()==null || documentPart.getStyleDefinitionsPart().getJaxbElement()==null) { throw new TocException("No StyleDefinitions present in package"); } return new TocStyles(documentPart.getStyleDefinitionsPart()); }
if (this.getJaxbElement()==null) throw new Docx4JException("StyleDefinitionsPart null content"); if (this.getJaxbElement().getLatentStyles()==null) throw new Docx4JException("StyleDefinitionsPart content missing latentStyles"); this.getJaxbElement().getLatentStyles().setDefLockedState(Boolean.TRUE); for (LsdException lsdException : this.getJaxbElement().getLatentStyles().getLsdException()) { for (Style s : this.getJaxbElement().getStyle()) { this.getJaxbElement().getStyle().removeAll(deletions);
for ( org.docx4j.wml.Style s : this.getJaxbElement().getStyle() ) { if( s.getType().equals("paragraph") && s.getName()!=null for ( org.docx4j.wml.Style s : this.getJaxbElement().getStyle() ) { if( s.getType().equals("paragraph") && s.getStyleId().equals("style0") ) {
protected TocStyles(StyleDefinitionsPart sdp) { this.stylesPartStyles = sdp.getJaxbElement();
styles = (org.docx4j.wml.Styles)styleDefinitionsPart.getJaxbElement(); initialiseLiveStyles(); DocDefaults docDefaults = styleDefinitionsPart.getJaxbElement().getDocDefaults(); if(log.isDebugEnabled()) { log.debug(XmlUtils.marshaltoString(docDefaults, true, true));
Styles styles = wmlPackage.getMainDocumentPart().getStyleDefinitionsPart().getJaxbElement();
@Override public String getMceIgnorable() { return this.getJaxbElement().getIgnorable(); }
private void initStyleMap(StyleDefinitionsPart sdp) { if (sdp==null) return; org.docx4j.wml.Styles styles = sdp.getJaxbElement(); for ( org.docx4j.wml.Style s : styles.getStyle() ) { stylesByID.put(s.getStyleId(), s); } }
/** * @param id * @return * @since 3.0.0 */ public Style getStyleById(String id) { return getStyleById( this.getJaxbElement().getStyle(), id ); }
@Override protected void setMceIgnorable(McIgnorableNamespaceDeclarator namespacePrefixMapper) { // NB if you add ignorable content, it is up to you to jaxbElement.setIgnorable correctly; see further McIgnorableNamespaceDeclarator // You don't need to worry about this if you are merely loading an existing part. namespacePrefixMapper.setMcIgnorable( this.getJaxbElement().getIgnorable() ); }
private Style getDefaultStyle(String type) { for ( org.docx4j.wml.Style s : this.getJaxbElement().getStyle() ) { if( s.isDefault() && s.getType().equals(type)) { log.debug("Style with name " + s.getName().getVal() + ", id '" + s.getStyleId() + "' is default " + s.getType() + " style"); return s; } } return null; }
private TocStyles getTocStyles(MainDocumentPart documentPart) throws TocException { // Styles styles = null; if (documentPart.getStyleDefinitionsPart()==null || documentPart.getStyleDefinitionsPart().getJaxbElement()==null) { throw new TocException("No StyleDefinitions present in package"); } return new TocStyles(documentPart.getStyleDefinitionsPart()); }