Examples of HeaderFooterHelper


Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

   * Create an instance of XSSFHeaderFooter from the supplied XML bean
   * @param headerFooter
   */
    public XSSFHeaderFooter(CTHeaderFooter headerFooter) {
       this.headerFooter = headerFooter;
       this.helper = new HeaderFooterHelper();
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

   *
   * @param headerFooter
   */
  public XSSFHeaderFooter(CTHeaderFooter headerFooter) {
    this.headerFooter = headerFooter;
    this.helper = new HeaderFooterHelper();
  }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper


public class TestHeaderFooterHelper extends TestCase {
   
    public void testGetCenterLeftRightSection() {
        HeaderFooterHelper helper = new HeaderFooterHelper();
        String headerFooter = "&CTest the center section";
        assertEquals("Test the center section", helper.getCenterSection(headerFooter));
        headerFooter = "&CTest the center section&LThe left one&RAnd the right one";
        assertEquals("Test the center section", helper.getCenterSection(headerFooter));
        assertEquals("The left one", helper.getLeftSection(headerFooter));
        assertEquals("And the right one", helper.getRightSection(headerFooter));
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

        assertEquals("The left one", helper.getLeftSection(headerFooter));
        assertEquals("And the right one", helper.getRightSection(headerFooter));
    }
   
    public void testSetCenterLeftRightSection() {
        HeaderFooterHelper helper = new HeaderFooterHelper();
        String headerFooter = "";
        headerFooter = helper.setCenterSection(headerFooter, "First added center section");
        assertEquals("First added center section", helper.getCenterSection(headerFooter));
        headerFooter = helper.setLeftSection(headerFooter, "First left");
        assertEquals("First left", helper.getLeftSection(headerFooter));

        headerFooter = helper.setRightSection(headerFooter, "First right");
        assertEquals("First right", helper.getRightSection(headerFooter));
        assertEquals("&CFirst added center section&LFirst left&RFirst right", headerFooter);

        headerFooter = helper.setRightSection(headerFooter, "First right&amp");
        assertEquals("First right&amp", helper.getRightSection(headerFooter));
        assertEquals("&CFirst added center section&LFirst left&RFirst right&amp", headerFooter);
       
        headerFooter = helper.setRightSection(headerFooter, "First right&");
        assertEquals("First right", helper.getRightSection(headerFooter));
        assertEquals("&CFirst added center section&LFirst left&RFirst right&", headerFooter);
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

    public XSSFHeaderFooter(CTHeaderFooter headerFooter) {
       this.headerFooter = headerFooter;
       this.value = getText();
       this.value = this.value != null ? this.value : "";
       this.helper = new HeaderFooterHelper();
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

        assertEquals("The left one", helper.getLeftSection(headerFooter));
        assertEquals("And the right one", helper.getRightSection(headerFooter));
    }
   
    public void testSetCenterLeftRightSection() {
        HeaderFooterHelper helper = new HeaderFooterHelper();
        String headerFooter = "";
        headerFooter = helper.setCenterSection(headerFooter, "First added center section");
        assertEquals("First added center section", helper.getCenterSection(headerFooter));
        headerFooter = helper.setLeftSection(headerFooter, "First left");
        assertEquals("First left", helper.getLeftSection(headerFooter));

        headerFooter = helper.setRightSection(headerFooter, "First right");
        assertEquals("First right", helper.getRightSection(headerFooter));
        assertEquals("&CFirst added center section&LFirst left&RFirst right", headerFooter);

        headerFooter = helper.setRightSection(headerFooter, "First right&F");
        assertEquals("First right&F", helper.getRightSection(headerFooter));
        assertEquals("&CFirst added center section&LFirst left&RFirst right&F", headerFooter);
       
        headerFooter = helper.setRightSection(headerFooter, "First right&");
        assertEquals("First right&", helper.getRightSection(headerFooter));
        assertEquals("&CFirst added center section&LFirst left&RFirst right&", headerFooter);
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

*  and not &
*/
public class TestHeaderFooterHelper extends TestCase {
   
    public void testGetCenterLeftRightSection() {
        HeaderFooterHelper helper = new HeaderFooterHelper();
       
        String headerFooter = "&CTest the center section";
        assertEquals("Test the center section", helper.getCenterSection(headerFooter));
       
        headerFooter = "&CTest the center section&LThe left one&RAnd the right one";
        assertEquals("Test the center section", helper.getCenterSection(headerFooter));
        assertEquals("The left one", helper.getLeftSection(headerFooter));
        assertEquals("And the right one", helper.getRightSection(headerFooter));
    }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

   *
   * @param headerFooter
   */
  public XSSFHeaderFooter(CTHeaderFooter headerFooter) {
    this.headerFooter = headerFooter;
    this.helper = new HeaderFooterHelper();
  }
View Full Code Here

Examples of org.apache.poi.xssf.usermodel.helpers.HeaderFooterHelper

  private boolean stripFields = false;
 
    public XSSFHeaderFooter(CTHeaderFooter headerFooter) {
       this.headerFooter = headerFooter;
       this.helper = new HeaderFooterHelper();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.