@Override public String toString() { return formatAsString(); }
@Override public final String toString() { CellAddress crA = new CellAddress(_firstRow, _firstCol); CellAddress crB = new CellAddress(_lastRow, _lastCol); return getClass().getName() + " [" + crA.formatAsString() + ":" + crB.formatAsString() +"]"; }
private void dumpEmptyCellComment(CellAddress cellAddress, XSSFBComment comment) { handler.cell(cellAddress.formatAsString(), null, comment); }
/** * Get a Hyperlink in this sheet located in a cell specified by {code addr} * * @param addr The address of the cell containing the hyperlink * @return hyperlink if there is a hyperlink anchored at {@code addr}; otherwise returns {@code null} * @since POI 3.15 beta 3 */ @Override public XSSFHyperlink getHyperlink(CellAddress addr) { String ref = addr.formatAsString(); for(XSSFHyperlink hyperlink : hyperlinks) { if(hyperlink.getCellRef().equals(ref)) { return hyperlink; } } return null; }
/** * Output an empty-cell comment. */ private void outputEmptyCellComment(CellAddress cellRef) { XSSFComment comment = comments.findCellComment(cellRef); output.cell(cellRef.formatAsString(), null, comment); }
/** * Returns an A1 style reference to the location of this cell * * @return A1 style reference to the location of this cell */ public String getReference() { String ref = _cell.getR(); if(ref == null) { return getAddress().formatAsString(); } return ref; }
/** * {@inheritDoc} */ @Override public void setActiveCell(CellAddress address) { final CTSelection ctsel = getSheetTypeSelection(true); assert(ctsel != null); String ref = address.formatAsString(); ctsel.setActiveCell(ref); ctsel.setSqref(Collections.singletonList(ref)); }
/** * Remove the comment at cellRef location, if one exists * * @param cellRef the location of the comment to remove * @return returns true if a comment was removed */ @Override public boolean removeComment(CellAddress cellRef) { final String stringRef = cellRef.formatAsString(); CTCommentList lst = comments.getCommentList(); if(lst != null) { CTComment[] commentArray = lst.getCommentArray(); for (int i = 0; i < commentArray.length; i++) { CTComment comment = commentArray[i]; if (stringRef.equals(comment.getRef())) { lst.removeComment(i); if(commentRefs != null) { commentRefs.remove(cellRef); } return true; } } } return false; }
private void handleCellValue(String formattedValue) { CellAddress cellAddress = new CellAddress(currentRow, cellBuffer.getColNum()); XSSFBComment comment = null; if (comments != null) { comment = comments.get(cellAddress); } handler.cell(cellAddress.formatAsString(), formattedValue, comment); }
/** * Create a new comment located` at cell address * * @param ref the location to add the comment * @return a new CTComment located at ref with default author */ @Internal public CTComment newComment(CellAddress ref) { CTComment ct = comments.getCommentList().addNewComment(); ct.setRef(ref.formatAsString()); ct.setAuthorId(DEFAULT_AUTHOR_ID); if(commentRefs != null) { commentRefs.put(ref, ct); } return ct; }
@Override public void setAddress(CellAddress address) { CellAddress oldRef = new CellAddress(_comment.getRef()); if (address.equals(oldRef)) { // nothing to do return; } _comment.setRef(address.formatAsString()); _comments.referenceUpdated(oldRef, _comment); if (_vmlShape != null) { CTClientData clientData = _vmlShape.getClientDataArray(0); clientData.setRowArray(0, new BigInteger(String.valueOf(address.getRow()))); clientData.setColumnArray(0, new BigInteger(String.valueOf(address.getColumn()))); avoidXmlbeansCorruptPointer(_vmlShape); } }
cellReference = new CellAddress(currentRow, currentCol).formatAsString();
@Override public String toString() { return formatAsString(); }
@Override public final String toString() { CellAddress crA = new CellAddress(_firstRow, _firstCol); CellAddress crB = new CellAddress(_lastRow, _lastCol); return getClass().getName() + " [" + crA.formatAsString() + ":" + crB.formatAsString() +"]"; }
private void dumpEmptyCellComment(CellAddress cellAddress, XSSFBComment comment) { handler.cell(cellAddress.formatAsString(), null, comment); }
/** * Generate a cell address in A1 format from a row and column number * * @param rowNum row number * @param columnNum column number * * @return Address in A1 format * */ public static String getCellAddressA1Format(int rowNum, int columnNum) { CellAddress cellAddr = new CellAddress(rowNum, columnNum); return cellAddr.formatAsString(); }
/** * Returns an A1 style reference to the location of this cell * * @return A1 style reference to the location of this cell */ public String getReference() { String ref = _cell.getR(); if(ref == null) { return getAddress().formatAsString(); } return ref; }
/** * Output an empty-cell comment. */ private void outputEmptyCellComment(CellAddress cellRef) { XSSFComment comment = comments.findCellComment(cellRef); output.cell(cellRef.formatAsString(), null, comment); }
/** * {@inheritDoc} */ @Override public void setActiveCell(CellAddress address) { final CTSelection ctsel = getSheetTypeSelection(true); assert(ctsel != null); String ref = address.formatAsString(); ctsel.setActiveCell(ref); ctsel.setSqref(Collections.singletonList(ref)); }
private void handleCellValue(String formattedValue) { CellAddress cellAddress = new CellAddress(currentRow, cellBuffer.getColNum()); XSSFBComment comment = null; if (comments != null) { comment = comments.get(cellAddress); } handler.cell(cellAddress.formatAsString(), formattedValue, comment); }