Package org.openxmlformats.schemas.spreadsheetml.x2006.main

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.STXstring


     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

    }
View Full Code Here


     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

    }
View Full Code Here

     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

    }
View Full Code Here

        XSSFFont font = new XSSFFont();
        font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
        font.setFontHeightInPoints((short) 14);
        XSSFRichTextString str;
        STXstring t1, t2, t3;

        str = new XSSFRichTextString("Incorrect\nLine-Breaking");
        str.applyFont(0, 8, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Incorrec</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment>t\nLine-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Incorrect\nLine-Breaking");
        str.applyFont(0, 9, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Incorrect</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\nLine-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Incorrect\n Line-Breaking");
        str.applyFont(0, 9, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Incorrect</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\n Line-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Tab\tseparated\n");
        t1 = str.getCTRst().xgetT();
        // trailing \n causes must be preserved
        assertEquals("<xml-fragment xml:space=\"preserve\">Tab\tseparated\n</xml-fragment>", t1.xmlText());

        str.applyFont(0, 3, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Tab</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\tseparated\n</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Tab\tseparated\n");
        str.applyFont(0, 4, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        // YK: don't know why, but XmlBeans converts leading tab characters to spaces
        //assertEquals("<xml-fragment>Tab\t</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">separated\n</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("\n\n\nNew Line\n\n");
        str.applyFont(0, 3, font);
        str.applyFont(11, 13, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        t3 = str.getCTRst().getRList().get(2).xgetT();
        // YK: don't know why, but XmlBeans converts leading tab characters to spaces
        assertEquals("<xml-fragment xml:space=\"preserve\">\n\n\n</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment>New Line</xml-fragment>", t2.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\n\n</xml-fragment>", t3.xmlText());
    }
View Full Code Here

     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

    }
View Full Code Here

     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

        rt.append(" POI");
        rt.append(" ");
        assertEquals("  Apache POI ", rt.getString());
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", rt.getCTRst().getRArray(0).xgetT().xmlText());
View Full Code Here

        XSSFFont font = new XSSFFont();
        font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
        font.setFontHeightInPoints((short) 14);
        XSSFRichTextString str;
        STXstring t1, t2, t3;

        str = new XSSFRichTextString("Incorrect\nLine-Breaking");
        str.applyFont(0, 8, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Incorrec</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment>t\nLine-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Incorrect\nLine-Breaking");
        str.applyFont(0, 9, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Incorrect</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\nLine-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Incorrect\n Line-Breaking");
        str.applyFont(0, 9, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Incorrect</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\n Line-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Tab\tseparated\n");
        t1 = str.getCTRst().xgetT();
        // trailing \n causes must be preserved
        assertEquals("<xml-fragment xml:space=\"preserve\">Tab\tseparated\n</xml-fragment>", t1.xmlText());

        str.applyFont(0, 3, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        assertEquals("<xml-fragment>Tab</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\tseparated\n</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Tab\tseparated\n");
        str.applyFont(0, 4, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        // YK: don't know why, but XmlBeans converts leading tab characters to spaces
        //assertEquals("<xml-fragment>Tab\t</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">separated\n</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("\n\n\nNew Line\n\n");
        str.applyFont(0, 3, font);
        str.applyFont(11, 13, font);
        t1 = str.getCTRst().getRList().get(0).xgetT();
        t2 = str.getCTRst().getRList().get(1).xgetT();
        t3 = str.getCTRst().getRList().get(2).xgetT();
        // YK: don't know why, but XmlBeans converts leading tab characters to spaces
        assertEquals("<xml-fragment xml:space=\"preserve\">\n\n\n</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment>New Line</xml-fragment>", t2.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\n\n</xml-fragment>", t3.xmlText());
    }
View Full Code Here

     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

    }
View Full Code Here

     * if a string has leading or trailing white spaces
     */
    public void testPreserveSpaces() {
        XSSFRichTextString rt = new XSSFRichTextString("Apache");
        CTRst ct = rt.getCTRst();
        STXstring xs = ct.xgetT();
        assertEquals("<xml-fragment>Apache</xml-fragment>", xs.xmlText());
        rt.setString("  Apache");
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", xs.xmlText());

        rt.append(" POI");
        rt.append(" ");
        assertEquals("  Apache POI ", rt.getString());
        assertEquals("<xml-fragment xml:space=\"preserve\">  Apache</xml-fragment>", rt.getCTRst().getRArray(0).xgetT().xmlText());
View Full Code Here

        XSSFFont font = new XSSFFont();
        font.setBoldweight(XSSFFont.BOLDWEIGHT_BOLD);
        font.setFontHeightInPoints((short) 14);
        XSSFRichTextString str;
        STXstring t1, t2, t3;

        str = new XSSFRichTextString("Incorrect\nLine-Breaking");
        str.applyFont(0, 8, font);
        t1 = str.getCTRst().getRArray(0).xgetT();
        t2 = str.getCTRst().getRArray(1).xgetT();
        assertEquals("<xml-fragment>Incorrec</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment>t\nLine-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Incorrect\nLine-Breaking");
        str.applyFont(0, 9, font);
        t1 = str.getCTRst().getRArray(0).xgetT();
        t2 = str.getCTRst().getRArray(1).xgetT();
        assertEquals("<xml-fragment>Incorrect</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\nLine-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Incorrect\n Line-Breaking");
        str.applyFont(0, 9, font);
        t1 = str.getCTRst().getRArray(0).xgetT();
        t2 = str.getCTRst().getRArray(1).xgetT();
        assertEquals("<xml-fragment>Incorrect</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\n Line-Breaking</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Tab\tseparated\n");
        t1 = str.getCTRst().xgetT();
        // trailing \n causes must be preserved
        assertEquals("<xml-fragment xml:space=\"preserve\">Tab\tseparated\n</xml-fragment>", t1.xmlText());

        str.applyFont(0, 3, font);
        t1 = str.getCTRst().getRArray(0).xgetT();
        t2 = str.getCTRst().getRArray(1).xgetT();
        assertEquals("<xml-fragment>Tab</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\tseparated\n</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("Tab\tseparated\n");
        str.applyFont(0, 4, font);
        t1 = str.getCTRst().getRArray(0).xgetT();
        t2 = str.getCTRst().getRArray(1).xgetT();
        // YK: don't know why, but XmlBeans converts leading tab characters to spaces
        //assertEquals("<xml-fragment>Tab\t</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">separated\n</xml-fragment>", t2.xmlText());

        str = new XSSFRichTextString("\n\n\nNew Line\n\n");
        str.applyFont(0, 3, font);
        str.applyFont(11, 13, font);
        t1 = str.getCTRst().getRArray(0).xgetT();
        t2 = str.getCTRst().getRArray(1).xgetT();
        t3 = str.getCTRst().getRArray(2).xgetT();
        // YK: don't know why, but XmlBeans converts leading tab characters to spaces
        assertEquals("<xml-fragment xml:space=\"preserve\">\n\n\n</xml-fragment>", t1.xmlText());
        assertEquals("<xml-fragment>New Line</xml-fragment>", t2.xmlText());
        assertEquals("<xml-fragment xml:space=\"preserve\">\n\n</xml-fragment>", t3.xmlText());
    }
View Full Code Here

TOP

Related Classes of org.openxmlformats.schemas.spreadsheetml.x2006.main.STXstring

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.