Examples of CTCommentList


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

  }
 
  public void testGetCellComment() {
    CTComments comments = CTComments.Factory.newInstance();
    CommentsTable sheetComments = new CommentsTable(comments);
    CTCommentList commentList = comments.addNewCommentList();
   
    // Create 2 comments for A1 and A" cells
    CTComment comment0 = commentList.insertNewComment(0);
    comment0.setRef("A1");
    CTRst ctrst0 = CTRst.Factory.newInstance();
    ctrst0.setT(TEST_A1_TEXT);
    comment0.setText(ctrst0);
    CTComment comment1 = commentList.insertNewComment(0);
    comment1.setRef("A2");
    CTRst ctrst1 = CTRst.Factory.newInstance();
    ctrst1.setT(TEST_A2_TEXT);
    comment1.setText(ctrst1);
   
View Full Code Here

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

  }
 
  public void testAddCellComment() {
    CTComments comments = CTComments.Factory.newInstance();
    CommentsTable sheetComments = new CommentsTable(comments);
    CTCommentList commentList = comments.addNewCommentList();
    assertEquals(0, commentList.sizeOfCommentArray());
   
    XSSFComment comment = sheetComments.addComment();
    comment.setAuthor("test A1 author");
    comment.setRow(0);
    comment.setColumn((short)0);
   
    assertEquals(1, commentList.sizeOfCommentArray());
    assertEquals("test A1 author", sheetComments.getAuthor(commentList.getCommentArray(0).getAuthorId()));
    assertEquals("test A1 author", comment.getAuthor());
   
    // Change the author, check it updates
    comment.setAuthor("Another Author");
    assertEquals(1, commentList.sizeOfCommentArray());
    assertEquals("Another Author", comment.getAuthor());
  }
View Full Code Here

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

        }
        return ct;
    }

    public boolean removeComment(String cellRef) {
        CTCommentList lst = comments.getCommentList();
        if(lst != null) for(int i=0; i < lst.sizeOfCommentArray(); i++) {
            CTComment comment = lst.getCommentArray(i);
            if (cellRef.equals(comment.getRef())) {
                lst.removeComment(i);
               
                if(commentRefs != null) {
                   commentRefs.remove(cellRef);
                }
                return true;
View Full Code Here

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

                row.shift(n);
            }

            if(sheetComments != null){
                //TODO shift Note's anchor in the associated /xl/drawing/vmlDrawings#.vml
                CTCommentList lst = sheetComments.getCTComments().getCommentList();
                for (CTComment comment : lst.getCommentList()) {
                    CellReference ref = new CellReference(comment.getRef());
                    if(ref.getRow() == rownum){
                        ref = new CellReference(rownum + n, ref.getCol());
                        comment.setRef(ref.formatAsString());
                    }
View Full Code Here

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

        }
        return ct;
    }

    public boolean removeComment(String cellRef) {
        CTCommentList lst = comments.getCommentList();
        if(lst != null) for(int i=0; i < lst.sizeOfCommentArray(); i++) {
            CTComment comment = lst.getCommentArray(i);
            if (cellRef.equals(comment.getRef())) {
                lst.removeComment(i);
               
                if(commentRefs != null) {
                   commentRefs.remove(cellRef);
                }
                return true;
View Full Code Here

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

  public void testGetCellComment() throws Exception {
    CommentsTable sheetComments = new CommentsTable();

    CTComments comments = sheetComments.getCTComments();
    CTCommentList commentList = comments.getCommentList();

    // Create 2 comments for A1 and A" cells
    CTComment comment0 = commentList.insertNewComment(0);
    comment0.setRef("A1");
    CTRst ctrst0 = CTRst.Factory.newInstance();
    ctrst0.setT(TEST_A1_TEXT);
    comment0.setText(ctrst0);
    CTComment comment1 = commentList.insertNewComment(0);
    comment1.setRef("A2");
    CTRst ctrst1 = CTRst.Factory.newInstance();
    ctrst1.setT(TEST_A2_TEXT);
    comment1.setText(ctrst1);
View Full Code Here

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

  public void testGetCellComment() throws Exception {
    CommentsTable sheetComments = new CommentsTable();

    CTComments comments = sheetComments.getCTComments();
    CTCommentList commentList = comments.getCommentList();

    // Create 2 comments for A1 and A" cells
    CTComment comment0 = commentList.insertNewComment(0);
    comment0.setRef("A1");
    CTRst ctrst0 = CTRst.Factory.newInstance();
    ctrst0.setT(TEST_A1_TEXT);
    comment0.setText(ctrst0);
    CTComment comment1 = commentList.insertNewComment(0);
    comment1.setRef("A2");
    CTRst ctrst1 = CTRst.Factory.newInstance();
    ctrst1.setT(TEST_A2_TEXT);
    comment1.setText(ctrst1);
View Full Code Here

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

        }
        return ct;
    }

    public boolean removeComment(String cellRef) {
        CTCommentList lst = comments.getCommentList();
        if(lst != null) {
            CTComment[] commentArray = lst.getCommentArray();
            for (int i = 0; i < commentArray.length; i++) {
                CTComment comment = commentArray[i];
                if (cellRef.equals(comment.getRef())) {
                    lst.removeComment(i);

                    if(commentRefs != null) {
                       commentRefs.remove(cellRef);
                    }
                    return true;
View Full Code Here

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

            XSSFRow row = (XSSFRow)it.next();
            int rownum = row.getRowNum();

            if(sheetComments != null){
                //TODO shift Note's anchor in the associated /xl/drawing/vmlDrawings#.vml
                CTCommentList lst = sheetComments.getCTComments().getCommentList();
                for (CTComment comment : lst.getCommentArray()) {
                    String oldRef = comment.getRef();
                    CellReference ref = new CellReference(oldRef);
                    if(ref.getRow() == rownum){
                        ref = new CellReference(rownum + n, ref.getCol());
                        comment.setRef(ref.formatAsString());
View Full Code Here

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

                row.shift(n);
            }

            if(sheetComments != null){
                //TODO shift Note's anchor in the associated /xl/drawing/vmlDrawings#.vml
                CTCommentList lst = sheetComments.getCTComments().getCommentList();
                for (CTComment comment : lst.getCommentArray()) {
                    CellReference ref = new CellReference(comment.getRef());
                    if(ref.getRow() == rownum){
                        ref = new CellReference(rownum + n, ref.getCol());
                        comment.setRef(ref.formatAsString());
                    }
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.