Package org.docx4j.model.listnumbering

Examples of org.docx4j.model.listnumbering.ListNumberingDefinition


        }

        // instantiate the list number definitions
        for( Numbering.Num numNode : numbering.getNum() )
        {
            ListNumberingDefinition listDef
              = new ListNumberingDefinition(numNode, abstractListDefinitions);

            instanceListDefinitions.put(listDef.getListNumberId(), listDef);
//            log.debug("Added list: " + listDef.getListNumberId() );
        }

    }
View Full Code Here


            continue;                       
          }
          BigInteger concreteListId = styleNumPr.getNumId().getVal();
         
          // Get the target abstract num
          ListNumberingDefinition lnd = getInstanceListDefinitions().get(concreteListId.toString());
          if (lnd==null) {
            log.warn("No ListNumberingDefinition entry with ID " + concreteListId.toString());
          }
          Numbering.AbstractNum linkedNum = lnd.getAbstractListDefinition().getAbstractNumNode();

          // OK, update
            AbstractListNumberingDefinition absNumDef
              = abstractListDefinitions.get(abstractNum.getAbstractNumId().toString());
           
View Full Code Here

     
      // (Ensure maps are initialised)
      if (em == null ) {
        getEmulator();
      }
      ListNumberingDefinition existingLnd = instanceListDefinitions.get( Long.toString(numId) );
      if (existingLnd==null) {
        throw new InvalidOperationException("List " + numId + " does not exist");
      }
      BigInteger abstractNumIdVal = existingLnd.getNumNode().getAbstractNumId().getVal();
     
      // Generate the new <w:num
      long newNumId = instanceListDefinitions.size() + 1;
     
    org.docx4j.wml.ObjectFactory factory = Context.getWmlObjectFactory();
   
    Num newNum = factory.createNumberingNum();
    newNum.setNumId( BigInteger.valueOf(newNumId) );
    AbstractNumId abstractNumId = factory.createNumberingNumAbstractNumId();
    abstractNumId.setVal(abstractNumIdVal);
    newNum.setAbstractNumId(abstractNumId);
   
    LvlOverride lvlOverride = factory.createNumberingNumLvlOverride();
    lvlOverride.setIlvl(BigInteger.valueOf(ilvl));
    newNum.getLvlOverride().add(lvlOverride);
   
    StartOverride start = factory.createNumberingNumLvlOverrideStartOverride();
    start.setVal(BigInteger.valueOf(val));
    lvlOverride.setStartOverride(start);
     
      // Add it to the jaxb object and our hashmap
    ((Numbering)getJaxbElement()).getNum().add(newNum);
        ListNumberingDefinition listDef
        = new ListNumberingDefinition(newNum, abstractListDefinitions);
        instanceListDefinitions.put(listDef.getListNumberId(), listDef);   
     
      // Return the new numId
      return newNumId;
     
    }
View Full Code Here

 
  public Ind getInd(String numId, String ilvl) {

    // Operating on the docx4j.listnumbering plane,
    // not the JAXB plane..
    ListNumberingDefinition lnd = getInstanceListDefinitions().get(numId );
    if (lnd==null) {
      log.debug("couldn't find list for numId: " + numId);
      return null;
    }
    if (ilvl==null) ilvl = "0";
    ListLevel ll = lnd.getLevel(ilvl);
    if (ll==null) {
      log.warn("No ListLevel defined for level " + ilvl + " in list " + numId);
      return null;
    }
   
View Full Code Here

     
      // Add it to our JAXB object
      this.getJaxbElement().getNum().add(num);
     
      // Add it to our hashmap
        ListNumberingDefinition listDef = new ListNumberingDefinition(num, abstractListDefinitions);
        instanceListDefinitions.put(listDef.getListNumberId(), listDef);
       
        //
      return num;
   
  }
View Full Code Here

    sdtPr.setTag(tag);
   
    sdtList.setSdtPr(sdtPr);
   
    // Bullets = UL.  Work it out.
    ListNumberingDefinition lnd = ndp.getInstanceListDefinitions().get(numId.toString());
    if (lnd==null) {
      // Default to UL
      log.warn("Couldn't find instance list for numId " + numId);
      tag.setVal("HTML_ELEMENT=OL");
      return;
    }
   
    AbstractListNumberingDefinition ald = lnd.getAbstractListDefinition();
    if (ald==null) {
      // Default to UL
      log.warn("Couldn't find abstract list for instance list " + numId);
      tag.setVal("HTML_ELEMENT=OL");
      return;
View Full Code Here

TOP

Related Classes of org.docx4j.model.listnumbering.ListNumberingDefinition

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.