entry.getKey().setRow(entry.getValue());
/** * Assign a cell comment to a cell region in this worksheet * * @param cellRef cell region * @param comment the comment to assign * @deprecated since Nov 2009 use {@link XSSFCell#setCellComment(org.apache.poi.ss.usermodel.Comment)} instead */ @Deprecated public static void setCellComment(String cellRef, XSSFComment comment) { CellReference cellReference = new CellReference(cellRef); comment.setRow(cellReference.getRow()); comment.setColumn(cellReference.getCol()); }
entry.getKey().setRow(entry.getValue());
/** * Creates a comment. * @param anchor the client anchor describes how this comment is attached * to the sheet. * @return the newly created comment. */ public XSSFComment createCellComment(ClientAnchor anchor) { XSSFClientAnchor ca = (XSSFClientAnchor)anchor; XSSFSheet sheet = (XSSFSheet)getParent(); //create comments and vmlDrawing parts if they don't exist CommentsTable comments = sheet.getCommentsTable(true); XSSFVMLDrawing vml = sheet.getVMLDrawing(true); schemasMicrosoftComVml.CTShape vmlShape = vml.newCommentShape(); if(ca.isSet()){ String position = ca.getCol1() + ", 0, " + ca.getRow1() + ", 0, " + ca.getCol2() + ", 0, " + ca.getRow2() + ", 0"; vmlShape.getClientDataArray(0).setAnchorArray(0, position); } XSSFComment shape = new XSSFComment(comments, comments.newComment(), vmlShape); shape.setColumn(ca.getCol1()); shape.setRow(ca.getRow1()); return shape; }