Codota Logo
StyleDefinitionsPart
Code IndexAdd Codota to your IDE (free)

How to use
StyleDefinitionsPart
in
org.docx4j.openpackaging.parts.WordprocessingML

Best Java code snippets using org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart (Showing top 20 results out of 315)

  • Common ways to obtain StyleDefinitionsPart
private void myMethod () {
StyleDefinitionsPart s =
  • Codota IconWordprocessingMLPackage wordprocessingMLPackage;wordprocessingMLPackage.getMainDocumentPart().getStyleDefinitionsPart()
  • Smart code suggestions by Codota
}
origin: plutext/docx4j

public StyleDefinitionsPart getStyleDefinitionsPart(boolean create) {
  if (styleDefinitionsPart==null
      && create) {
    // HTML, PDF output won't work without this
    log.info("No StyleDefinitionsPart detected. Adding default part.");
    try {
      styleDefinitionsPart = new StyleDefinitionsPart();
      styleDefinitionsPart.unmarshalDefaultStyles();
      this.addTargetPart(styleDefinitionsPart); 			
      
    } catch (Exception e) {
      log.error(e.getMessage(), e);
    }
  }
  return styleDefinitionsPart;
}
origin: plutext/docx4j

  ((StyleDefinitionsPart)part).getContents().setLatentStyles(null);
} else {
  deletions.add(r );                        
origin: plutext/docx4j

@Override
public String getMceIgnorable() {
  return this.getJaxbElement().getIgnorable();
}
 
origin: plutext/docx4j

/**
 * @param id
 * @return
 * @since 3.0.0
 */
public Style getStyleById(String id) {
  
  return getStyleById( this.getJaxbElement().getStyle(), id ); 				
}
origin: plutext/docx4j

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;
}
 
origin: plutext/docx4j

Styles styles = getStyleDefinitionsPart().getJaxbElement();		
for ( org.docx4j.wml.Style s : styles.getStyle() ) {				
  allStyles.put(s.getStyleId(), s);    
    getStyleDefinitionsPart().getJaxbElement().getDocDefaults(), 
    getStyleDefinitionsPart().getDefaultParagraphStyle());
origin: plutext/docx4j

  defaultParagraphStyleId = this.styleDefinitionsPart.getDefaultParagraphStyle().getStyleId();
} catch (NullPointerException npe) {
  log.warn("No default paragraph style!!");
  defaultCharacterStyleId = this.styleDefinitionsPart.getDefaultCharacterStyle().getStyleId();
} catch (NullPointerException npe) {
  log.warn("No default character style!!");
styles = (org.docx4j.wml.Styles)styleDefinitionsPart.getJaxbElement();	
initialiseLiveStyles();        
DocDefaults docDefaults = styleDefinitionsPart.getJaxbElement().getDocDefaults();
if(log.isDebugEnabled()) {
  log.debug(XmlUtils.marshaltoString(docDefaults, true, true));
origin: plutext/docx4j

      .getStyleDefinitionsPart().getDefaultParagraphStyle().getStyleId());
} catch (NullPointerException npe) {
  log.warn("No default paragraph style!!");
    .getStyleDefinitionsPart().getDefaultTableStyle();
if (defaultTableStyle != null) {
  styleRenamer.setDefaultTableStyle(defaultTableStyle);
Styles styles = wmlPackage.getMainDocumentPart().getStyleDefinitionsPart().getJaxbElement();
origin: vsch/flexmark-java

Part stylesPart = new org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart();
final Styles styles = (Styles) XmlUtils.unmarshalString(STYLES_XML.getFrom(options));
((org.docx4j.openpackaging.parts.WordprocessingML.StyleDefinitionsPart) stylesPart).setJaxbElement(styles);
origin: plutext/docx4j

Style rStyle = getStyleById(rStyleVal);
if (rStyle==null) {
  log.info("Couldn't find rStyle " + rStyleVal);
    String pStyleVal = linkedStyle.getVal();
    log.debug(rStyleVal + " is linked to style " + pStyleVal );
    Style pStyle = getStyleById(pStyleVal);
origin: plutext/docx4j

finder.defaultCharacterStyle = this.getStyleDefinitionsPart().getDefaultCharacterStyle();
finder.defaultParagraphStyle = this.getStyleDefinitionsPart().getDefaultParagraphStyle();
finder.styleDefinitionsPart = this.getStyleDefinitionsPart();		
origin: plutext/docx4j

mdp.getStyleDefinitionsPart(true).setJaxbElement(transitionContainer.getStyles());
origin: plutext/docx4j

public Part CreateStyleDefinitionsPartObject(String partName) throws InvalidFormatException {
  return new StyleDefinitionsPart(new PartName(partName));
}
origin: plutext/docx4j

      pkg.getMainDocumentPart().getStyleDefinitionsPart(false).getDefaultCharacterStyle() :
  null);
Style pStyle = pkg.getMainDocumentPart().getStyleDefinitionsPart(false).getLinkedStyle(rStyleVal);
origin: plutext/docx4j-ImportXHTML

/**
 * Where @class is to be used as a mapping to an existing Word style,
 * we also want FS to use that Word style in the CSS it is applying
 * (since if this does not happen, some of the CSS applied will be 
 * default CSS, and this will overwrite the intended style with direct
 * formatting assuming CLASS_PLUS_OTHER) 
 * @param pkg
 * @return
 */
private String stylesToCSS() {
  
  String css = wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart().getCss();
  
  if (css==null) {
    StringBuilder result = new StringBuilder();
    HtmlCssHelper.createCssForStyles(wordMLPackage, wordMLPackage.getMainDocumentPart().getStyleTree(), result);
    css = result.toString();
    wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart().setCss(css);
  }
  
  log.info(css);
  
  return css;
}
 
origin: plutext/docx4j

private Style getDefaultPStyle() {
  
  if (defaultParagraphStyle==null) {
    defaultParagraphStyle = 
        (wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false) != null ?
            wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart(false).getDefaultParagraphStyle() :
        null);
  }
  return defaultParagraphStyle;
}
 
origin: plutext/docx4j

/**
 * @since 3.0
 */
public Style getDefaultTableStyle() {
  
  if (defaultTableStyle==null) {
    defaultTableStyle = getDefaultStyle("table");
  }
  return defaultTableStyle;
}
 
origin: plutext/docx4j

context.getWmlPackage().getMainDocumentPart().getStyleDefinitionsPart(false).getDefaultCharacterStyle() :
null);
origin: plutext/docx4j

protected TocStyles(StyleDefinitionsPart sdp) {
  this.stylesPartStyles = sdp.getJaxbElement();
  if (sdp.getDefaultParagraphStyle()!=null) {
    defaultPStyleName=sdp.getDefaultParagraphStyle().getName().getVal();
    defaultPStyleId = sdp.getDefaultParagraphStyle().getStyleId();
origin: plutext/docx4j

defaultParagraphStyle = getDefaultStyle("paragraph");
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") ) {
org.docx4j.openpackaging.parts.WordprocessingMLStyleDefinitionsPart

Most used methods

  • getJaxbElement

Popular in Java

  • Running tasks concurrently on multiple threads
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • getSharedPreferences (Context)
  • PrintStream (java.io)
    A PrintStream adds functionality to another output stream, namely the ability to print representatio
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now