Package org.openxmlformats.schemas.presentationml.x2006.main

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


           
            if (moveComments) {
              final CommentsTable sheetComments = getCommentsTable(false);
              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());
                      final int colnum = ref.getCol();
                      if(ref.getRow() == rownum && lCol <= colnum && colnum <= rCol){
                          ref = new CellReference(rownum + n, colnum);
                          comment.setRef(ref.formatAsString());
View Full Code Here


        //  exist for cells which are null
        if (moveComments) {
            final CommentsTable sheetComments = getCommentsTable(false);
            if(sheetComments != null){
                //TODO shift Note's anchor in the associated /xl/drawing/vmlDrawings#.vml
                CTCommentList lst = sheetComments.getCTComments().getCommentList();
                for (final Iterator<CTComment> it = lst.getCommentList().iterator(); it.hasNext();) {
                  CTComment comment = it.next();
                    CellReference ref = new CellReference(comment.getRef());
                    final int colnum = ref.getCol();
                    if(startCol <= colnum && colnum <= endCol){
                      int newColNum = colnum + n;
View Full Code Here

        //  exist for cells which are null
        if (moveComments) {
            final CommentsTable sheetComments = getCommentsTable(false);
            if(sheetComments != null){
                //TODO shift Note's anchor in the associated /xl/drawing/vmlDrawings#.vml
                CTCommentList lst = sheetComments.getCTComments().getCommentList();
                for (final Iterator<CTComment> it = lst.getCommentList().iterator(); it.hasNext();) {
                  CTComment comment = it.next();
                    CellReference ref = new CellReference(comment.getRef());
                    final int colnum = ref.getCol();
                    final int rownum = ref.getRow();
                    if(startCol <= colnum && colnum <= endCol && tRow <= rownum && rownum <= bRow){
View Full Code Here

        //  exist for cells which are null
        if (moveComments) {
            final CommentsTable sheetComments = getCommentsTable(false);
            if(sheetComments != null){
                //TODO shift Note's anchor in the associated /xl/drawing/vmlDrawings#.vml
                CTCommentList lst = sheetComments.getCTComments().getCommentList();
                for (final Iterator<CTComment> it = lst.getCommentList().iterator(); it.hasNext();) {
                  CTComment comment = it.next();
                    CellReference ref = new CellReference(comment.getRef());
                    final int colnum = ref.getCol();
                    final int rownum = ref.getRow();
                    if(lCol <= colnum && colnum <= rCol && tRow <= rownum && rownum <= bRow){
View Full Code Here

    CommentsTable sheetComments = new CommentsTable();
    sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));


    CTComments comments = sheetComments.getCTComments();
    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

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
    CommentsTable sheetComments = new CommentsTable();
    sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));

    CTCommentList commentList = sheetComments.getCTComments().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

                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

        }
        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

                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

        }
        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

TOP

Related Classes of org.openxmlformats.schemas.presentationml.x2006.main.CTCommentList

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.