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

How to use
PropertyResolver
in
org.docx4j.model

Best Java code snippets using org.docx4j.model.PropertyResolver (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: plutext/docx4j

private PPr getEffectivePPr(P p) {
  PPr pPrDirect = p.getPPr();
  return propertyResolver.getEffectivePPr(pPrDirect);  
}
 
origin: plutext/docx4j

private RPr getEffectiveRPr(RPr expressRPr) {
  
  RPr resolvedRPr = null;
  if (expressRPr != null && expressRPr.getRStyle() != null ) {
    String runStyleId = expressRPr.getRStyle().getVal();
    resolvedRPr = propertyResolver.getEffectiveRPr(runStyleId);
    
    // remove the style, so it is not set by apply below
    expressRPr.setRStyle(null);
  }
  
  return StyleUtil.apply(expressRPr, resolvedRPr);
}

origin: plutext/docx4j

public PropertyResolver getPropertyResolver() {
  if (propertyResolver==null) {
    try {
      propertyResolver = new PropertyResolver( (WordprocessingMLPackage)this.pack);
    } catch (Docx4JException e) {
      e.printStackTrace();
    }            
  }
  return propertyResolver;
}
 
origin: plutext/docx4j

private void addDefaultParagraphFontToResolvedStyleRPrComponent() {
Stack<RPr> rPrStack = new Stack<RPr>();
  fillRPrStack(defaultParagraphStyleId, rPrStack);
    // Since default font size might be in there.
  
  fillRPrStack(defaultCharacterStyleId, rPrStack);
  rPrStack.push(documentDefaultRPr);
    
  RPr effectiveRPr = factory.createRPr();
  
  // Now, apply the properties starting at the top of the stack
  while (!rPrStack.empty() ) {
    RPr rPr = rPrStack.pop();
    applyRPr(rPr, effectiveRPr);
  }
  resolvedStyleRPrComponent.put(defaultCharacterStyleId, effectiveRPr);        
}
 
origin: plutext/docx4j

  private void addNormalToResolvedStylePPrComponent() {
    
    Stack<PPr> pPrStack = new Stack<PPr>();
//        String styleId = "Normal";
    String styleId = defaultParagraphStyleId;
    
    fillPPrStack(styleId, pPrStack);
    pPrStack.push(documentDefaultPPr);
      
    PPr effectivePPr = factory.createPPr();            
    // Now, apply the properties starting at the top of the stack
    while (!pPrStack.empty() ) {
      PPr pPr = pPrStack.pop();
      applyPPr(pPr, effectivePPr);
    }
    resolvedStylePPrComponent.put(styleId, effectivePPr);        
  }
 
origin: plutext/docx4j

    RPr pPrLevelRunStyle = getEffectiveRPr(pPr.getPStyle().getVal());
    return getEffectiveRPrUsingPStyleRPr(expressRPr, pPrLevelRunStyle);
  if ((expressRPr == null) && (pPr.getRPr() != null) && (hasDirectRPrFormatting(pPr.getRPr())) ) {			
    return getEffectiveRPrUsingPStyleRPr(expressRPr, 
        StyleUtil.apply(pPr.getRPr(), Context.getWmlObjectFactory().createRPr()));
return getEffectiveRPrUsingPStyleRPr( expressRPr, null);
origin: plutext/docx4j

PPr effectivePPr = propertyResolver.getEffectivePPr(styleVal);
Jc effectiveJc = effectivePPr.getJc();
RPr effectiveRPr = propertyResolver.getEffectiveRPr(styleVal);
HpsMeasure effectiveFontSize = null;
if (effectiveRPr!=null) {
    this.propertyResolver.getDocumentDefaultPPr(),
    newStyle);
StyleUtil.apply(
    this.propertyResolver.getDocumentDefaultRPr(),
    newStyle);
propertyResolver.activateStyle(newStyle);
origin: plutext/docx4j

public boolean activateStyle(org.docx4j.wml.Style s) {
  return activateStyle(s, true);
  
}
origin: plutext/docx4j

resolvedPPr = getEffectivePPr(styleId);
if (hasDirectPPrFormatting(expressPPr) ) {
  if (resolvedPPr==null) {
    log.warn("resolvedPPr was null. Look into this?");
    effectivePPr = (PPr)XmlUtils.deepCopy(resolvedPPr);
  applyPPr(expressPPr, effectivePPr);
  return effectivePPr;
} else {
origin: plutext/docx4j

if (expressRPr != null && expressRPr.getRStyle() != null ) {
  runStyleId = expressRPr.getRStyle().getVal();
  resolvedRPr = getEffectiveRPr(runStyleId);
  StyleUtil.apply(resolvedRPr, effectiveRPr);
if (hasDirectRPrFormatting(expressRPr) ) {			
origin: plutext/docx4j

style = propertyResolver.getStyle(pStyleVal); 
    PPr ppr = propertyResolver.getEffectivePPr(pStyleVal);
origin: plutext/docx4j

  pRPr = propertyResolver.getEffectiveRPr(pStyleId);
rPr = propertyResolver.getEffectiveRPrUsingPStyleRPr(rPr, pRPr); 
origin: plutext/docx4j

initialiseLiveStyles();		
addNormalToResolvedStylePPrComponent();
addDefaultParagraphFontToResolvedStyleRPrComponent();
origin: plutext/docx4j

int level = getLvlFromHeadingStyle(styleId);
if (level>0
    && style.getPPr()!=null
String basedOnStyleName = style.getBasedOn().getVal();               
log.debug("Style " + styleId + " is based on " + basedOnStyleName);
fillPPrStack( basedOnStyleName, pPrStack);
Style basedOnStyle = liveStyles.get(basedOnStyleName);
if (ascertainNumId && basedOnStyle!=null) {
origin: org.docx4j/docx4j

PPr effectivePPr = propertyResolver.getEffectivePPr(styleVal);
Jc effectiveJc = effectivePPr.getJc();
RPr effectiveRPr = propertyResolver.getEffectiveRPr(styleVal);
HpsMeasure effectiveFontSize = null;
if (effectiveRPr!=null) {
    this.propertyResolver.getDocumentDefaultPPr(),
    newStyle);
StyleUtil.apply(
    this.propertyResolver.getDocumentDefaultRPr(),
    newStyle);
propertyResolver.activateStyle(newStyle);
origin: plutext/docx4j

public boolean activateStyle( String styleId  ) {
  
  if (liveStyles.get(styleId)!=null) {
    // Its already live - nothing to do
    return true;    		
  }
  // Assumption here is that it doesn't exist in your styles part, so..
  java.util.Map<String, org.docx4j.wml.Style> knownStyles 
    = StyleDefinitionsPart.getKnownStyles(); // NB KnownStyles.xml, not those in docx!
  
  org.docx4j.wml.Style s = knownStyles.get(styleId);
  
  if (s==null) {
    log.error("Unknown style: " + styleId);
    return false;
  }
      
  return activateStyle(s, false); 
    // false -> don't replace an existing live style with a template
  
}
 
origin: org.docx4j/docx4j

    RPr pPrLevelRunStyle = getEffectiveRPr(pPr.getPStyle().getVal());
    return getEffectiveRPrUsingPStyleRPr(expressRPr, pPrLevelRunStyle);
  if ((expressRPr == null) && (pPr.getRPr() != null) && (hasDirectRPrFormatting(pPr.getRPr())) ) {			
    return getEffectiveRPrUsingPStyleRPr(expressRPr, 
        StyleUtil.apply(pPr.getRPr(), Context.getWmlObjectFactory().createRPr()));
return getEffectiveRPrUsingPStyleRPr( expressRPr, null);
origin: org.docx4j/docx4j

resolvedPPr = getEffectivePPr(styleId);
if (hasDirectPPrFormatting(expressPPr) ) {
  if (resolvedPPr==null) {
    log.warn("resolvedPPr was null. Look into this?");
    effectivePPr = (PPr)XmlUtils.deepCopy(resolvedPPr);
  applyPPr(expressPPr, effectivePPr);
  return effectivePPr;
} else {
origin: org.docx4j/docx4j

if (expressRPr != null && expressRPr.getRStyle() != null ) {
  runStyleId = expressRPr.getRStyle().getVal();
  resolvedRPr = getEffectiveRPr(runStyleId);
  StyleUtil.apply(resolvedRPr, effectiveRPr);
if (hasDirectRPrFormatting(expressRPr) ) {			
origin: org.docx4j/docx4j

style = propertyResolver.getStyle(pStyleVal); 
    PPr ppr = propertyResolver.getEffectivePPr(pStyleVal);
org.docx4j.modelPropertyResolver

Javadoc

This class works out the actual set of properties (paragraph or run) which apply, following the order specified in ECMA-376. From ECMA-376 > Part3 > 2 Introduction to WordprocessingML > 2.8 Styles > 2.8.10 Style Application at http://www.documentinteropinitiative.org/implnotes/ecma-376/P3-2.8.10.aspx (See also Part 4, 2.7.2 which is the normative bit...) With the various flavors of styles available, multiple style types can be applied to the same content within a file, which means that properties must be applied in a specific deterministic order. As with inheritance, the resulting formatting properties set by one type can be unchanged, removed, or altered by following types. The following table illustrates the order of application of these defaults, and which properties are impacted by each: This process can be described as follows: First, the document defaults are applied to all runs and paragraphs in the document. Next, the table style properties are applied to each table in the document, following the conditional formatting inclusions and exclusions specified per table. Next, numbered item and paragraph properties are applied to each paragraph formatted with a numbering style. Next, paragraph and run properties are applied to each paragraph as defined by the paragraph style. Next, run properties are applied to each run with a specific character style applied. Finally, we apply direct formatting (paragraph or run properties not from styles). ----------- Things which are unclear: - the role of w:link on a paragraph style (eg Heading1 links to "Heading1char"), experimentation in Word 2007 suggests the w:link is not used at all - indeed, "Heading1char" is not used at all? ----------- docx4all does not use this; its org.docx4all.swing.text.StyleSheet uses MutableAttributeSet's resolve function to climb the style hierarchy. This is most relevant to XSLFO, which unlike CSS, doesn't have a concept of style. HTML NG2 uses CSS inheritance, and so doesn't need it.

Most used methods

  • getEffectivePPr
    Follow the resolution rules to return the paragraph properties which actually apply, given this pPr
  • getEffectiveRPr
  • <init>
  • activateStyle
  • addDefaultParagraphFontToResolvedStyleRPrComponent
  • addNormalToResolvedStylePPrComponent
  • applyPPr
  • applyRPr
  • fillPPrStack
    Ascend (recursively) the style hierarchy, capturing the pPr bit. Doesn't use StyleTree.
  • fillRPrStack
    Ascend the style hierarchy, capturing the rPr bit
  • fillTableStyleStack
    Ascend the style hierarchy, capturing the table styles
  • getDocumentDefaultPPr
  • fillTableStyleStack,
  • getDocumentDefaultPPr,
  • getDocumentDefaultRPr,
  • getEffectiveRPrUsingPStyleRPr,
  • getEffectiveTableStyle,
  • getLvlFromHeadingStyle,
  • getStyle,
  • hasDirectPPrFormatting,
  • hasDirectRPrFormatting,
  • init

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
    Returns a stream for the resource with the specified name. See #getResource(String) for a descriptio
  • startActivity (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • BufferedReader (java.io)
    Reads text from a character-input stream, buffering characters so as to provide for the efficient re
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JTextField (javax.swing)
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