- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {OutputStreamWriter o =
OutputStream out;new OutputStreamWriter(out)
OutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
HttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
- Smart code suggestions by Codota
}
private PPr getEffectivePPr(P p) { PPr pPrDirect = p.getPPr(); return propertyResolver.getEffectivePPr(pPrDirect); }
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); }
public PropertyResolver getPropertyResolver() { if (propertyResolver==null) { try { propertyResolver = new PropertyResolver( (WordprocessingMLPackage)this.pack); } catch (Docx4JException e) { e.printStackTrace(); } } return propertyResolver; }
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); }
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); }
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);
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);
public boolean activateStyle(org.docx4j.wml.Style s) { return activateStyle(s, true); }
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 {
if (expressRPr != null && expressRPr.getRStyle() != null ) { runStyleId = expressRPr.getRStyle().getVal(); resolvedRPr = getEffectiveRPr(runStyleId); StyleUtil.apply(resolvedRPr, effectiveRPr); if (hasDirectRPrFormatting(expressRPr) ) {
style = propertyResolver.getStyle(pStyleVal); PPr ppr = propertyResolver.getEffectivePPr(pStyleVal);
pRPr = propertyResolver.getEffectiveRPr(pStyleId); rPr = propertyResolver.getEffectiveRPrUsingPStyleRPr(rPr, pRPr);
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) {
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);
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 }
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);
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 {
if (expressRPr != null && expressRPr.getRStyle() != null ) { runStyleId = expressRPr.getRStyle().getVal(); resolvedRPr = getEffectiveRPr(runStyleId); StyleUtil.apply(resolvedRPr, effectiveRPr); if (hasDirectRPrFormatting(expressRPr) ) {
style = propertyResolver.getStyle(pStyleVal); PPr ppr = propertyResolver.getEffectivePPr(pStyleVal);