Ignore:
Timestamp:
10/25/09 12:08:24 (2 years ago)
Author:
jharrop
Message:

Added DocumentModel?. DocumentModel? is a list of SectionWrappers?; a SectionWrapper? has a HeaderFooterPolicy?, PageDimensions? and sectPr.
HeaderFooterPolicy? moved to new package, as there will be 1 per SectionWrapper?.

TblFactory? is a way to create simple tables; now used in the Create..Document sample.

Debug of JAXBElement.
NamespacePrefixMapper?: convenient static method.

WordXmlPicture?: add @id,containing relId.

MDP styles in use:recurse into tables

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java

    r905 r943  
    4141import org.docx4j.fonts.Mapper; 
    4242import org.docx4j.jaxb.Context; 
    43 import org.docx4j.model.HeaderFooterPolicy; 
     43import org.docx4j.model.structure.DocumentModel; 
     44import org.docx4j.model.structure.HeaderFooterPolicy; 
     45import org.docx4j.model.structure.PageDimensions; 
    4446import org.docx4j.openpackaging.contenttype.ContentType; 
    4547import org.docx4j.openpackaging.contenttype.ContentTypeManager; 
     
    5961import org.docx4j.openpackaging.parts.relationships.Namespaces; 
    6062import org.docx4j.wml.Document; 
     63import org.docx4j.wml.SectPr; 
    6164import org.docx4j.wml.Styles; 
    6265 
     
    104107        protected GlossaryDocumentPart glossaryDoc; 
    105108         
    106         private HeaderFooterPolicy headerFooterPolicy; 
     109        private DocumentModel documentModel; 
     110        public DocumentModel getDocumentModel() { 
     111                if (documentModel==null) { 
     112                        documentModel = new DocumentModel(this); 
     113                } 
     114                return documentModel; 
     115        } 
     116         
     117         
     118        private HeaderFooterPolicy headerFooterPolicy;   
     119        @Deprecated      
    107120        public HeaderFooterPolicy getHeaderFooterPolicy() { 
    108                 if (headerFooterPolicy==null) { 
    109                         headerFooterPolicy = new HeaderFooterPolicy(this); 
    110                 } 
    111                 return headerFooterPolicy; 
    112         } 
    113         public void setHeaderFooterPolicy(HeaderFooterPolicy headerFooterPolicy) { 
    114                 this.headerFooterPolicy = headerFooterPolicy; 
    115         } 
    116          
     121                 
     122                return getDocumentModel().getSections().get(0).getHeaderFooterPolicy(); 
     123        } 
    117124         
    118125        /** 
     
    355362                org.docx4j.wml.Document wmlDocumentEl = factory.createDocument(); 
    356363                wmlDocumentEl.setBody(body); 
     364                 
     365                // Create a basic sectPr using our Page model 
     366                PageDimensions page = new PageDimensions(); 
     367                SectPr sectPr = factory.createSectPr(); 
     368                body.setSectPr(sectPr); 
     369                sectPr.setPgSz(page.createPgSize() ); 
     370                sectPr.setPgMar(page.createPgMar()); 
    357371                                 
    358372                // Put the content in the part 
Note: See TracChangeset for help on using the changeset viewer.