Package org.docx4j.wml

Examples of org.docx4j.wml.R$MonthLong


 
  private static P createContent(String textContent) {
   
    P p = Context.getWmlObjectFactory().createP();

      R r = Context.getWmlObjectFactory().createR();
      p.getContent().add( r);
          // Create object for t (wrapped in JAXBElement)
          Text text = Context.getWmlObjectFactory().createText();
          JAXBElement<org.docx4j.wml.Text> textWrapped = Context.getWmlObjectFactory().createRT(text);
          r.getContent().add( textWrapped);
              text.setValue( textContent);
             
              return p;
  }
View Full Code Here


  }
 
  private static R addFiller() {
   

      R r = Context.getWmlObjectFactory().createR();
          // Create object for t (wrapped in JAXBElement)
          Text text = Context.getWmlObjectFactory().createText();
          JAXBElement<org.docx4j.wml.Text> textWrapped = Context.getWmlObjectFactory().createRT(text);
          r.getContent().add( textWrapped);
              text.setValue( "The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. The cat sat on the mat. ");
             
              return r;
  }
View Full Code Here

    MainDocumentPart mdp = wordMLPackage.getMainDocumentPart();
   
      P p = new P();
      mdp.getContent().add(p);
     
      R r = Context.getWmlObjectFactory().createR();
     
      r.getContent().add(
         
          // Absolute position to the right of column produces:

        // margin-left:108pt
        // mso-position-horizontal:absolute <------------
View Full Code Here

    }
 
  protected P createUnnumberedP() {
   
    P p = wmlObjectFactory.createP();
        R r = wmlObjectFactory.createR();
        p.getContent().add( r);
            // Create object for t (wrapped in JAXBElement)
            Text text = wmlObjectFactory.createText();
            JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRT(text);
            r.getContent().add( textWrapped);
                text.setValue( "UnnumberedP");

    return p;
   
View Full Code Here

                    setFormFieldProperties(fr, fieldName, null);

                    // remove <w:highlight w:val="lightGray"/>, if present
                    // (corresponds in Word to clicking Legacy Forms > Form Field Shading)
                    // so that the result is not printed in grey
                    R resultR = fr.getResultsSlot();
                    if (resultR.getRPr() != null && resultR.getRPr().getHighlight() != null) {
                        resultR.getRPr().setHighlight(null);
                    }

                } else if (!fieldFate.equals(OutputField.KEEP_MERGEFIELD)) {
                    // If doing an actual mail merge, the begin-separate run is removed, as is the end run
                    fr.getParent().getContent().remove(fr.getBeginRun());
View Full Code Here

          setFormFieldProperties(fr, fieldName, null);
         
          // remove <w:highlight w:val="lightGray"/>, if present
          // (corresponds in Word to clicking Legacy Forms > Form Field Shading)
          // so that the result is not printed in grey
          R resultR = fr.getResultsSlot();
          if (resultR.getRPr()!=null
              && resultR.getRPr().getHighlight()!=null) {
            resultR.getRPr().setHighlight(null);
          }
         
        } else if (!fieldFate.equals(OutputField.KEEP_MERGEFIELD)) {
          // If doing an actual mail merge, the begin-separate run is removed, as is the end run       
          fr.getParent().getContent().remove(fr.getBeginRun());
View Full Code Here

   
    List<Object> resultElts = new ArrayList<Object>();
    SdtBlock currentBlock = null;
    CTBorder lastBorder = null;
    CTBorder currentBorder = null;
    R run = null;
   
//      java.util.Stack stack = new java.util.Stack();
//      stack.push(newList);
   
    for (Object o : paragraphElts) {
      if (o instanceof R) {
        run = (R)o;
        currentBorder = null;
        if (run.getRPr() != null ) {
          currentBorder = run.getRPr().getBdr();
        }
       
        if ( borderChanged(currentBorder, lastBorder )) {
          appendRun(currentBlock, resultElts);
          currentBlock = null;
          // could mean null to borders; borders to null; or bordersA to bordersB
          if (currentBorder != null) {
            currentBlock = createSdt(TAG_RPR, run.getRPr());
          }
        }
      }
      if (currentBlock!=null) {
        currentBlock.getSdtContent().getContent().add(o);
View Full Code Here

  }

  private static void appendRun(SdtBlock currentBlock, List<Object> resultElts) {
   
    List<Object> blkElements = null;
    R run = null;
    RPr blockRPr = null;
    if (currentBlock != null) {
      blkElements = currentBlock.getSdtContent().getContent();
      if (blkElements.size() == 1) {
        //If there is only one element, there is no need to use a sdtBlock
        resultElts.add(blkElements.get(0));
      }
      else {
        resultElts.add(currentBlock);
        //Remove the borders of the child elements
        //(and the shading if it is the same as that of the container)
        blockRPr = findBlockRPr(currentBlock);
        for (Object elem:blkElements) {
          if (elem instanceof R) {
            run = (R)elem;
            if (run.getRPr() != null) {
              run.getRPr().setBdr(null);
              if (!shadingChanged(blockRPr.getShd(), run.getRPr().getShd())) {
                run.getRPr().setShd(null);
              }
            }
          }
        }
      }
View Full Code Here

            // Create object for pStyle
//            PPrBase.PStyle pprbasepstyle = wmlObjectFactory.createPPrBasePStyle();
//            ppr.setPStyle(pprbasepstyle);
//                pprbasepstyle.setVal( "ListParagraph");
        // Create object for r
        R r = wmlObjectFactory.createR();
        p.getContent().add( r);
            // Create object for t (wrapped in JAXBElement)
            Text text = wmlObjectFactory.createText();
            JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRT(text);
            r.getContent().add( textWrapped);
                text.setValue( "list " + numId + ", ilvl " + ilvl);

    return p;
    }
View Full Code Here

      If this is not the first child of this w:r, look at the preceding sibling
*/
   
    boolean firstBr = true; // until proven otherwise
   
    R r = (R)br.getParent();
    int pos = getPos(r.getContent(), br);
    if (pos<0) {
      log.error("Couldn't locate w:br in w:r");
    }
    else if (pos==0) {
      // Need to look in preceding run
      Object rParent = r.getParent();
      // Handle just the case where this is w:p for now
      if(rParent instanceof P) {
        P parentP = (P)rParent;
        pos = getPos(parentP.getContent(), r);
        if (pos<0) {
          log.error("Couldn't locate w:r in w:p");
        } else if (pos>0) {
          Object beforeR = parentP.getContent().get(pos-1);
          if (beforeR instanceof R) {
            List list = ((R)beforeR).getContent();
            Object previous = list.get(list.size()-1);
            if (previous instanceof Br) {
              firstBr=false;
            }
          } else {
//            System.out.println(beforeR.getClass().getName());
           
          }
        }
      } else {
        log.info("TODO: handle run parent " + rParent.getClass().getName());
      }
    } else {
      Object previous = r.getContent().get(pos-1);
      if (previous instanceof Br) {
        firstBr=false;
      } else {
//        System.out.println("previous: " + previous.getClass().getName());
      }
View Full Code Here

TOP

Related Classes of org.docx4j.wml.R$MonthLong

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.