Package org.docx4j.wml

Examples of org.docx4j.wml.Text


      P p = (P)document.getContent().get(i);
     
      PPr pPr = p.getPPr();
      RPr rPr = ((R)p.getContent().get(0)).getRPr();
     
      Text wmlText = (Text)XmlUtils.unwrap(((R)p.getContent().get(0)).getContent().get(0));
     
      log.debug(wmlText.getValue());
     
      Object result = rfs.fontSelector(pPr, rPr, wmlText);
//      System.out.println(result.getClass().getName());
     
      DocumentFragment df = (DocumentFragment)result;
View Full Code Here


        NodeIterator rPrNodeIt,
        NodeIterator textNodeIt) {

    PPr pPr = null;
    RPr rPr = null;
    Text text = null;
     
//      if (rPrNodeIt!=null)
    {
        Node n = pPrNodeIt.nextNode(); //It is never null
        if (n!=null) {
View Full Code Here

          } else {
            r.getContent().clear();
          }
          simpleField.getContent().clear()
          simpleField.getContent().add(r);
          Text t = Context.getWmlObjectFactory().createText();
          t.setValue(val);
          // t.setSpace(value) //TODO
          r.getContent().add(t);
         
  //        System.out.println(XmlUtils.marshaltoString(simpleField, true, true));
        }
View Full Code Here

                  HpsMeasure hpsmeasure3 = wmlObjectFactory.createHpsMeasure();
                  rpr.setSz(hpsmeasure3);
                      hpsmeasure3.setVal( BigInteger.valueOf( 96) );

              // 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( "BODY CONTENT");

      return p;
    }   
View Full Code Here

        fldchar.setDirty(true);
        r.getContent().add(getWrappedFldChar(fldchar));
        paragraphForTOC.getContent().add(r);

        R r1 = factory.createR();
        Text txt = new Text();
        txt.setSpace("preserve");
        txt.setValue("TOC \\o \"1-3\" \\h \\z \\u \\h");
        r.getContent().add(factory.createRInstrText(txt) );
        paragraphForTOC.getContent().add(r1);

        FldChar fldcharend = factory.createFldChar();
        fldcharend.setFldCharType(STFldCharType.END);
View Full Code Here

      for (Object o : children) {
       
        if (o instanceof javax.xml.bind.JAXBElement
            && ((JAXBElement)o).getName().getLocalPart().equals("instrText")) {
          // preserve this, but set its parent
          Text t = (Text)XmlUtils.unwrap(o);
          t.setParent(parent);
        } else {             
          o = XmlUtils.unwrap(o);
        }
       
        // workaround for broken getParent (since 3.0.0)
View Full Code Here

          FldChar fldchar = wmlObjectFactory.createFldChar();
          JAXBElement<org.docx4j.wml.FldChar> fldcharWrapped = wmlObjectFactory.createRFldChar(fldchar);
          r.getContent().add( fldcharWrapped);
              fldchar.setFldCharType(org.docx4j.wml.STFldCharType.BEGIN);
          // Create object for instrText (wrapped in JAXBElement)
          Text text = wmlObjectFactory.createText();
          JAXBElement<org.docx4j.wml.Text> textWrapped = wmlObjectFactory.createRInstrText(text);
          r.getContent().add( textWrapped);
              text.setValue( instrText);
              text.setSpace( "preserve");  

          // Create object for fldChar (wrapped in JAXBElement)
          fldchar = wmlObjectFactory.createFldChar();
          fldcharWrapped = wmlObjectFactory.createRFldChar(fldchar);
          r.getContent().add( fldcharWrapped);
View Full Code Here

    }

    field.setInstr(instr);

    R r = wmlObjectFactory.createR();
    Text t = wmlObjectFactory.createText();

    r.getContent().add(t);
    field.getContent().add(r);

    t.setValue("guess");

    return field;
  }
View Full Code Here

TOP

Related Classes of org.docx4j.wml.Text

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.