/** * Finds the cell comment at cellAddress, if one exists * * @param cellAddress the address of the cell to find a comment * @return cell comment if one exists, otherwise returns null */ @Override public XSSFComment findCellComment(CellAddress cellAddress) { CTComment ct = getCTComment(cellAddress); return ct == null ? null : new XSSFComment(this, ct, null); }
/** * Returns all cell comments on this sheet. * @return A map of each Comment in this sheet, keyed on the cell address where * the comment is located. * @deprecated use <code>getCellAddresses</code> instead */ @Removal(version = "4.2") @Deprecated public Map<CellAddress, XSSFComment> getCellComments() { prepareCTCommentCache(); final TreeMap<CellAddress, XSSFComment> map = new TreeMap<>(); for (final Entry<CellAddress, CTComment> e : commentRefs.entrySet()) { map.put(e.getKey(), new XSSFComment(this, e.getValue(), null)); } return map; }
/** * Return cell comment at row, column, if one exists. Otherwise returns null. * * @param address the location of the cell comment * @return the cell comment, if one exists. Otherwise return null. */ @Override public XSSFComment getCellComment(CellAddress address) { if (sheetComments == null) { return null; } final int row = address.getRow(); final int column = address.getColumn(); CellAddress ref = new CellAddress(row, column); 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)); }
int newColumnIndex = shiftedRowNum(startColumnIndex, endColumnIndex, n, columnIndex); if(newColumnIndex != columnIndex){ XSSFComment xssfComment = new XSSFComment(sheetComments, comment, vml == null ? null : vml.findCommentShape(ref.getRow(), columnIndex)); commentsToShift.put(xssfComment, newColumnIndex);
XSSFComment xssfComment = new XSSFComment(sheetComments, comment, vml == null ? null : vml.findCommentShape(rownum, ref.getCol()));
return new XSSFComment(comments, comments.newComment(ref), vmlShape);
/** * Finds the cell comment at cellAddress, if one exists * * @param cellAddress the address of the cell to find a comment * @return cell comment if one exists, otherwise returns null */ @Override public XSSFComment findCellComment(CellAddress cellAddress) { CTComment ct = getCTComment(cellAddress); return ct == null ? null : new XSSFComment(this, ct, null); }
public XSSFComment findCellComment(String cellRef) { CTComment ct = getCTComment(cellRef); return ct == null ? null : new XSSFComment(this, ct, null); }
/** * Returns all cell comments on this sheet. * @return A map of each Comment in this sheet, keyed on the cell address where * the comment is located. * @deprecated use <code>getCellAddresses</code> instead */ @Removal(version = "4.2") @Deprecated public Map<CellAddress, XSSFComment> getCellComments() { prepareCTCommentCache(); final TreeMap<CellAddress, XSSFComment> map = new TreeMap<>(); for (final Entry<CellAddress, CTComment> e : commentRefs.entrySet()) { map.put(e.getKey(), new XSSFComment(this, e.getValue(), null)); } return map; }
public XSSFComment getCellComment(int row, int column) { 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)); }
/** * Return cell comment at row, column, if one exists. Otherwise returns null. * * @param address the location of the cell comment * @return the cell comment, if one exists. Otherwise return null. */ @Override public XSSFComment getCellComment(CellAddress address) { if (sheetComments == null) { return null; } final int row = address.getRow(); final int column = address.getColumn(); CellAddress ref = new CellAddress(row, column); 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)); }
XSSFComment xssfComment = new XSSFComment(sheetComments, comment, vml == null ? null : vml.findCommentShape(rownum, ref.getCol()));
int newColumnIndex = shiftedRowNum(startColumnIndex, endColumnIndex, n, columnIndex); if(newColumnIndex != columnIndex){ XSSFComment xssfComment = new XSSFComment(sheetComments, comment, vml == null ? null : vml.findCommentShape(ref.getRow(), columnIndex)); commentsToShift.put(xssfComment, newColumnIndex);
return new XSSFComment(comments, comments.newComment(ref), vmlShape);
/** * 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; }