Search in sources :

Example 6 with CTR

use of org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR in project poi by apache.

the class TestXWPFTable method testGetText.

public void testGetText() {
    XWPFDocument doc = new XWPFDocument();
    CTTbl table = CTTbl.Factory.newInstance();
    CTRow row = table.addNewTr();
    CTTc cell = row.addNewTc();
    CTP paragraph = cell.addNewP();
    CTR run = paragraph.addNewR();
    CTText text = run.addNewT();
    text.setStringValue("finally I can write!");
    XWPFTable xtab = new XWPFTable(table, doc);
    assertEquals("finally I can write!\n", xtab.getText());
}
Also used : CTR(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR) CTText(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText) CTTbl(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl) CTRow(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRow) CTP(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP) CTTc(org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTc)

Aggregations

CTR (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTR)6 CTP (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP)4 CTText (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTText)3 Test (org.junit.Test)2 CTPPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPPr)2 CTRPr (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTRPr)2 CTLock (com.microsoft.schemas.office.office.CTLock)1 CTFormulas (com.microsoft.schemas.vml.CTFormulas)1 CTGroup (com.microsoft.schemas.vml.CTGroup)1 CTH (com.microsoft.schemas.vml.CTH)1 CTHandles (com.microsoft.schemas.vml.CTHandles)1 CTPath (com.microsoft.schemas.vml.CTPath)1 CTShape (com.microsoft.schemas.vml.CTShape)1 CTShapetype (com.microsoft.schemas.vml.CTShapetype)1 CTTextPath (com.microsoft.schemas.vml.CTTextPath)1 BigInteger (java.math.BigInteger)1 XWPFHeaderFooterPolicy (org.apache.poi.xwpf.model.XWPFHeaderFooterPolicy)1 XWPFParagraph (org.apache.poi.xwpf.usermodel.XWPFParagraph)1 CTFonts (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTFonts)1 CTPicture (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTPicture)1