Package org.docx4j.wml

Examples of org.docx4j.wml.Text


            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


    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

//                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

   
    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

      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

   

    private String getInstrText(R run) {
    List<Object> rContent = run.getContent();
    Object item = null;
    Text text = null;
      for (int i=0; i<rContent.size(); i++) {
        item = rContent.get(i);
        if (item instanceof JAXBElement
            && ((JAXBElement)item).getName().equals(_RInstrText_QNAME)) {
          text = (Text)((JAXBElement)item).getValue();
          break;
        }
      }
      return (text != null ? text.getValue() : null);
    }
View Full Code Here

      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

      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

      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

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.