Examples of CTComments


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

        XSSFComment comment = sheet.createComment();

        Cell cell = sheet.createRow(0).createCell((short)0);
        CommentsTable comments = sheet.getCommentsTable();
        CTComments ctComments = comments.getCTComments();

        sheet.setCellComment("A1", comment);
        assertEquals("A1", ctComments.getCommentList().getCommentArray(0).getRef());
        comment.setAuthor("test A1 author");
        assertEquals("test A1 author", comments.getAuthor((int)ctComments.getCommentList().getCommentArray(0).getAuthorId()));
    }
View Full Code Here

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

   
    public void testGetCellComment() {
        XSSFWorkbook workbook = new XSSFWorkbook();
        CTSheet ctSheet = CTSheet.Factory.newInstance();
        CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
        CTComments ctComments = CTComments.Factory.newInstance();
        CommentsTable sheetComments = new CommentsTable(ctComments);
        XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook, sheetComments);
        assertNotNull(sheet);
       
        // Create C10 cell
        Row row = sheet.createRow(9);
        row.createCell(2);
        row.createCell(3);
       
       
        // Set a comment for C10 cell
        CTComment ctComment = ctComments.addNewCommentList().insertNewComment(0);
        ctComment.setRef("C10");
        ctComment.setAuthorId(sheetComments.findAuthor(TEST_C10_AUTHOR));
       
        assertNotNull(sheet.getRow(9).getCell((short)2));
        assertNotNull(sheet.getRow(9).getCell((short)2).getCellComment());
View Full Code Here

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

   
    public void testSetCellComment() {
        XSSFWorkbook workbook = new XSSFWorkbook();
        CTSheet ctSheet = CTSheet.Factory.newInstance();
        CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
        CTComments ctComments = CTComments.Factory.newInstance();
        CommentsTable comments = new CommentsTable(ctComments);
        XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook, comments);
        assertNotNull(sheet);
       
        // Create C10 cell
        Row row = sheet.createRow(9);
        Cell cell = row.createCell(2);
        row.createCell(3);
       
        // Create a comment
        Comment comment = comments.addComment();
        comment.setAuthor(TEST_C10_AUTHOR);
       
        // Set a comment for C10 cell
        cell.setCellComment(comment);
       
        CTCell ctCell = ctWorksheet.getSheetData().getRowArray(0).getCArray(0);
    assertNotNull(ctCell);
    assertEquals("C10", ctCell.getR());
    long authorId = ctComments.getCommentList().getCommentArray(0).getAuthorId();
    assertEquals(TEST_C10_AUTHOR, comments.getAuthor(authorId));
    }
View Full Code Here

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

   
    public void testGetCellComment() {
        XSSFWorkbook workbook = new XSSFWorkbook();
        CTSheet ctSheet = CTSheet.Factory.newInstance();
        CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
        CTComments ctComments = CTComments.Factory.newInstance();
        CommentsTable sheetComments = new CommentsTable(ctComments);
        XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook, sheetComments);
        assertNotNull(sheet);
       
        CTComment ctComment = ctComments.addNewCommentList().insertNewComment(0);
        ctComment.setRef("C10");
        ctComment.setAuthorId(sheetComments.findAuthor("test C10 author"));
       
        assertNotNull(sheet.getCellComment(9, 2));
        assertEquals("test C10 author", sheet.getCellComment(9, 2).getAuthor());
View Full Code Here

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

        XSSFWorkbook workbook = new XSSFWorkbook();
        CTSheet ctSheet = CTSheet.Factory.newInstance();
        CTWorksheet ctWorksheet = CTWorksheet.Factory.newInstance();
        XSSFSheet sheet = new XSSFSheet(ctSheet, ctWorksheet, workbook);
        Cell cell = sheet.createRow(0).createCell((short)0);
        CTComments ctComments = CTComments.Factory.newInstance();
        CommentsTable comments = new CommentsTable(ctComments);
        XSSFComment comment = comments.addComment();
       
        sheet.setCellComment("A1", comment);
        assertEquals("A1", ctComments.getCommentList().getCommentArray(0).getRef());
        comment.setAuthor("test A1 author");
        assertEquals("test A1 author", comments.getAuthor(ctComments.getCommentList().getCommentArray(0).getAuthorId()));
    }
View Full Code Here

Examples of org.xlsx4j.sml.CTComments

                              +"</r>"
                          +"</text>"
                      +"</comment>"
                  +"</commentList>"
              +"</comments>";
      CTComments comments = (CTComments)XmlUtils.unwrap(
          XmlUtils.unmarshalString(openXML, Context.jcSML));
      return comments;
      }
View Full Code Here

Examples of org.xlsx4j.sml.CTComments

                          +"</r>"
                      +"</text>"
                  +"</comment>"
              +"</commentList>"
          +"</comments>";
      CTComments comments = (CTComments)XmlUtils.unwrap(
      XmlUtils.unmarshalString(openXML, Context.jcSML));
      return comments;
  }
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.