Package org.docx4j.wml

Examples of org.docx4j.wml.R$Tab


      if (rPr==null) {
        // Usual case, just reuse the fragment
        return placeholderFragment;
      } else {
        // Specific formatting
        R run = (R)XmlUtils.unmarshal(new ByteArrayInputStream(placeholderBytes));
        run.setRPr(rPr);
        Document tmpDoc = XmlUtils.marshaltoW3CDomDocument(run);
        DocumentFragment docfrag = tmpDoc.createDocumentFragment();
        XmlUtils.treeCopy(tmpDoc.getDocumentElement(), docfrag);           
        return docfrag;
      }
     
    } else {
     
      R run = (R)XmlUtils.unmarshal(new ByteArrayInputStream(placeholderBytes));
      run.setRPr(rPr);
      Document tmpDoc = XmlUtils.marshaltoW3CDomDocument(run);
     
      DocumentFragment docfrag = tmpDoc.createDocumentFragment();
     
      if (contentParent.equals("tbl")) {
View Full Code Here


    assertTrue(xml.contains("<w:bookmarkStart"));
    assertTrue(xml.contains("<w:bookmarkEnd"));
   
    // result slot contents
    FieldRef fieldRef1 =  fieldRefs.get(0);
    R r = fieldRef1.getResultsSlot();
    Text text = (Text)XmlUtils.unwrap(r.getContent().get(0));
    assertTrue(text.getValue().equals("(Customer)"));
   
  }
View Full Code Here

          // <w:r><w:rPr><w:rStyle
          // w:val="CommentReference"/></w:rPr><w:commentReference
          // w:id="0"/></w:r>
          P p = Context.getWmlObjectFactory().createP();
          R r = Context.getWmlObjectFactory().createR();
          p.getParagraphContent().add(r);

          R.CommentReference cr = Context.getWmlObjectFactory()
              .createRCommentReference();
          cr.setId( (BigInteger)id);
          r.getRunContent().add(cr);

          paragraphs.add(p);
        }

      }
View Full Code Here

 
  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

TOP

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

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.