Examples of CTComment


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

        if (sheetComments == null) {
            return null;
        }

        String ref = new CellReference(row, column).formatAsString();
        CTComment ctComment = sheetComments.getCTComment(ref);
        if(ctComment == null) return null;

        XSSFVMLDrawing vml = getVMLDrawing(false);
        return new XSSFComment(sheetComments, ctComment,
                vml == null ? null : vml.findCommentShape(row, column));
View Full Code Here

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

    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);

    // test finding the right comment for a cell
    assertSame(comment0, sheetComments.getCTComment("A1"));
    assertSame(comment1, sheetComments.getCTComment("A2"));
    assertNull(sheetComments.getCTComment("A3"));
View Full Code Here

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

    // Todo - check text too, once bug fixed
  }

    public void testRemoveComment() throws Exception {
        CommentsTable sheetComments = new CommentsTable();
        CTComment a1 = sheetComments.newComment();
        a1.setRef("A1");
        CTComment a2 = sheetComments.newComment();
        a2.setRef("A2");
        CTComment a3 = sheetComments.newComment();
        a3.setRef("A3");

        assertSame(a1, sheetComments.getCTComment("A1"));
        assertSame(a2, sheetComments.getCTComment("A2"));
        assertSame(a3, sheetComments.getCTComment("A3"));
        assertEquals(3, sheetComments.getNumberOfComments());
View Full Code Here

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

        }
        return addNewAuthor(author);
    }

    public XSSFComment findCellComment(String cellRef) {
        CTComment ct = getCTComment(cellRef);
        return ct == null ? null : new XSSFComment(this, ct, null);
    }
View Full Code Here

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

        }
        return null;
    }

    public CTComment newComment() {
        CTComment ct = comments.getCommentList().addNewComment();
        ct.setRef("A1");
        ct.setAuthorId(0);
        return ct;
    }
View Full Code Here

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

    }

    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);
                return true;
            }
        }
        return false;
View Full Code Here

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

    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);

    // test finding the right comment for a cell
    assertSame(comment0, sheetComments.getCTComment("A1"));
    assertSame(comment1, sheetComments.getCTComment("A2"));
    assertNull(sheetComments.getCTComment("A3"));
View Full Code Here

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

    // Todo - check text too, once bug fixed
  }

    public void testRemoveComment() throws Exception {
        CommentsTable sheetComments = new CommentsTable();
        CTComment a1 = sheetComments.newComment("A1");
        CTComment a2 = sheetComments.newComment("A2");
        CTComment a3 = sheetComments.newComment("A3");

        assertSame(a1, sheetComments.getCTComment("A1"));
        assertSame(a2, sheetComments.getCTComment("A2"));
        assertSame(a3, sheetComments.getCTComment("A3"));
        assertEquals(3, sheetComments.getNumberOfComments());
View Full Code Here

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

        if (sheetComments == null) {
            return null;
        }

        String ref = new CellReference(row, column).formatAsString();
        CTComment ctComment = sheetComments.getCTComment(ref);
        if(ctComment == null) return null;

        XSSFVMLDrawing vml = getVMLDrawing(false);
        return new XSSFComment(sheetComments, ctComment,
                vml == null ? null : vml.findCommentShape(row, column));
View Full Code Here

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

        if (sheetComments == null) {
            return null;
        }

        String ref = new CellReference(row, column).formatAsString();
        CTComment ctComment = sheetComments.getCTComment(ref);
        if(ctComment == null) return null;

        XSSFVMLDrawing vml = getVMLDrawing(false);
        return new XSSFComment(sheetComments, ctComment,
                vml == null ? null : vml.findCommentShape(row, column));
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.