Package org.docx4j.wml

Examples of org.docx4j.wml.BooleanDefaultTrue


      if (ppr==null) {
        ppr = Context.getWmlObjectFactory().createPPr();
        p.setPPr(ppr);
      }
      if (ppr.getCollapsed()==null) {
        BooleanDefaultTrue notCollapsed = new BooleanDefaultTrue();
        notCollapsed.setVal(Boolean.FALSE);
        ppr.setCollapsed(notCollapsed);
      }
    }
   
    return "w14 w15";
View Full Code Here


    RelationshipsPart rels = wordMLPackage.getMainDocumentPart().getRelationshipsPart();
       
    Document doc = (Document)wordMLPackage.getMainDocumentPart().getJaxbElement();
   
    HeaderFooterPolicy previousHF = null;
    BooleanDefaultTrue evenAndOddHeaders = null;
   
    if ((wordMLPackage.getMainDocumentPart().getDocumentSettingsPart() != null) &&
      (wordMLPackage.getMainDocumentPart().getDocumentSettingsPart().getJaxbElement() != null)) {
      evenAndOddHeaders = wordMLPackage.getMainDocumentPart().getDocumentSettingsPart().getJaxbElement().getEvenAndOddHeaders();
    }
View Full Code Here

      log.error("Passed null sectPr?!");
      return;
    }

    List<CTRel> hdrFtrRefs = null;
    BooleanDefaultTrue titlePage = null;
   
    if (sectPr.getType()!=null
        && "continuous".equals(sectPr.getType().getVal())) {
      // If this is a continuous section, use the headers/footers from the previous section!
      log.debug("this is a continuous section");

      if (previousHF!=null) {
       
        // for a continuous sectPr, ignore the stuff in this sectPr,
        // by taking our settings from previousHF

        firstHeaderActive=previousHF.firstHeaderActive;
        firstHeader=previousHF.firstHeader; 
        firstFooterActive=previousHF.firstFooterActive;
        firstFooter=previousHF.firstFooter;
       
        evenHeader=previousHF.evenHeader;
        evenFooter=previousHF.evenFooter;
       
        defaultHeader=previousHF.defaultHeader;
        defaultFooter=previousHF.defaultFooter;       
       
        return;
      }
    }

    // The usual non-continuous case
    // (or first sectPr in docx is continuous - maybe the docx starts with columns?)

    if (previousHF==null) {
      log.debug("previousHF==null");
      previousHF= new HeaderFooterPolicy();
     
    }    
    hdrFtrRefs = sectPr.getEGHdrFtrReferences();
    titlePage = sectPr.getTitlePg();
   
    // Headers.
    // Init from previousHF
    firstHeader   = previousHF.firstHeader;
    if (titlePage!=null && titlePage.isVal() ) {
      firstHeaderActive   = previousHF.firstHeader;
    }
   
    defaultHeader = previousHF.defaultHeader;
    evenHeader    =  previousHF.evenHeader;
    // and overwrite with whatever we have
    // specific to this sectPr
    setHeaderReferences(hdrFtrRefs, rels, titlePage );
   
    // Now, same for Footers.
    // Init from previousHF
    firstFooter   = previousHF.firstFooter;
    if (titlePage!=null && titlePage.isVal() ) {
      firstFooterActive   = previousHF.firstFooter;
    }
    defaultFooter = previousHF.defaultFooter;
    evenFooter    =  previousHF.evenFooter;
    // and overwrite with whatever we have
    // specific to this sectPr
    setFooterReferences(hdrFtrRefs, rels, titlePage );
   
    if ((titlePage != null) && (titlePage.isVal())) {
      if (firstHeaderActive == null) {
        firstHeaderActive = getDummyHeader();
      }
      if (firstFooterActive == null) {
        firstFooterActive = getDummyFooter();
View Full Code Here

    debug(CSS_NAME, value);
   
    if (value.getCssText().toLowerCase().equals("always")) {
      this.setObject( Context.getWmlObjectFactory().createBooleanDefaultTrue()  );
    } else {
      BooleanDefaultTrue bdt = Context.getWmlObjectFactory().createBooleanDefaultTrue();
      bdt.setVal(Boolean.FALSE);
    }
  }
View Full Code Here

    debug(CSS_NAME, value);
   
    if (value.getCssText().toLowerCase().equals("avoid")) {
      this.setObject( Context.getWmlObjectFactory().createBooleanDefaultTrue()  );
    } else {
      BooleanDefaultTrue bdt = Context.getWmlObjectFactory().createBooleanDefaultTrue();
      bdt.setVal(Boolean.FALSE);
    }
  }
View Full Code Here

    Object o = body.getContent().get(0);
   
    if (o instanceof P
        && ((P)o).getPPr()!=null) {
      PPr pPr = ((P)o).getPPr();
      BooleanDefaultTrue val = new BooleanDefaultTrue();
      val.setVal(Boolean.FALSE);
      pPr.setPageBreakBefore(val);
    }
  }
View Full Code Here

 

  @Override
  public void setXslFO(Element foElement) {

    BooleanDefaultTrue bdt = (BooleanDefaultTrue)this.getObject();
    if (bdt.isVal()) {
      /*
       * There is an impedence mismatch between docx format, and XSL FO,
       * since
       *
       * Per XSL-FO 1.1:
View Full Code Here

   
    // handle <w:cantSplit/>
    if (trPr != null) {
      JAXBElement<?> cantSplit = XmlUtils.getListItemByQName(trPr.getCnfStyleOrDivIdOrGridBefore(), new QName(Namespaces.NS_WORD12, "cantSplit"));
      if (cantSplit!=null) {
        BooleanDefaultTrue val = (BooleanDefaultTrue)XmlUtils.unwrap(cantSplit);
        if (val.isVal()) {
          properties.add(new TrCantSplit(cantSplit));         
        }
      }
    }
  }
View Full Code Here

    log.debug("complexified: " + XmlUtils.marshaltoString(input.getMainDocumentPart().getJaxbElement(), true));
    List<List<Object>> mdpResults = performOverList(input, input.getMainDocumentPart().getContent(), data, formTextFieldNames );

    // headers/footers
    Map<CTRel, JaxbXmlPart> hfTemplates = null;
    BooleanDefaultTrue titlePage = null;
    if (processHeadersAndFooters) {
      // then we need a clone/template of the headers/footers
      // in the first section
     
      hfTemplates = new HashMap<CTRel, JaxbXmlPart>();
     
      SectionWrapper sw = input.getDocumentModel().getSections().get(0);
      SectPr sectPr = sw.getSectPr();
     
      List<CTRel> hdrFtrRefs = sectPr.getEGHdrFtrReferences();
      titlePage = sectPr.getTitlePg();
     
      for (CTRel rel : hdrFtrRefs) {
        String relId = rel.getId();
        log.debug("for h|f relId: " + relId);
       
        JaxbXmlPart part = (JaxbXmlPart)input.getMainDocumentPart().getRelationshipsPart().getPart(relId);
        FieldsPreprocessor.complexifyFields(part );
       
        log.debug("complexified: " + XmlUtils.marshaltoString(part.getJaxbElement(), true));
       
        hfTemplates.put(rel, part);
      }
    }
   
    // Create WordprocessingMLPackage target, by cloning
    OpcPackage result = null;
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    SaveToZipFile saver = new SaveToZipFile(input);
    saver.save(baos);
    byte[] template = baos.toByteArray();
    WordprocessingMLPackage target = WordprocessingMLPackage.load(
        new ByteArrayInputStream(template));
   
   
    // populate main document part
    SectPr documentSeparator = getDocumentSeparator(target);
    if (processHeadersAndFooters) {
      if (titlePage!=null
          && titlePage.isVal()) {
        documentSeparator.setTitlePg(titlePage);
      }
      documentSeparator.getEGHdrFtrReferences().clear();
    }
    target.getMainDocumentPart().getContent().clear();
View Full Code Here

              JAXBElement<org.docx4j.wml.CTFFName> ffnameWrapped = wmlObjectFactory.createCTFFDataName(ffname);
              ffdata.getNameOrEnabledOrCalcOnExit().add( ffnameWrapped);
                  ffname.setVal(ffName);
                 
              // Create object for enabled (wrapped in JAXBElement)
              BooleanDefaultTrue booleandefaulttrue = wmlObjectFactory.createBooleanDefaultTrue();
              JAXBElement<org.docx4j.wml.BooleanDefaultTrue> booleandefaulttrueWrapped = wmlObjectFactory.createCTFFDataEnabled(booleandefaulttrue);
              ffdata.getNameOrEnabledOrCalcOnExit().add( booleandefaulttrueWrapped);
             
              // Create object for calcOnExit (wrapped in JAXBElement)
              BooleanDefaultTrue booleandefaulttrue2 = wmlObjectFactory.createBooleanDefaultTrue();
              JAXBElement<org.docx4j.wml.BooleanDefaultTrue> booleandefaulttrueWrapped2 = wmlObjectFactory.createCTFFDataCalcOnExit(booleandefaulttrue2);
              ffdata.getNameOrEnabledOrCalcOnExit().add( booleandefaulttrueWrapped2);
             
              // Create object for textInput (wrapped in JAXBElement)
              CTFFTextInput fftextinput = wmlObjectFactory.createCTFFTextInput();
View Full Code Here

TOP

Related Classes of org.docx4j.wml.BooleanDefaultTrue

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.