/** * {@inheritDoc} */ @Override public CellAddress getAddress() { return new CellAddress(this); }
/** * {@inheritDoc} */ @Override public CellAddress getAddress() { return new CellAddress(this); }
/** * {@inheritDoc} */ @Override public CellAddress getAddress() { return new CellAddress(this); }
/** * Retrieves the number of borders assigned to a cell * * @param row * @param col */ public int getNumBorders(int row, int col) { return getNumBorders(new CellAddress(row, col)); }
/** * Called after the reference is updated, so that * we can reflect that in our cache * @param oldReference the comment to remove from the commentRefs map * @param comment the comment to replace in the commentRefs map */ public void referenceUpdated(CellAddress oldReference, CTComment comment) { if(commentRefs != null) { commentRefs.remove(oldReference); commentRefs.put(new CellAddress(comment.getRef()), comment); } }
/** * Retrieves the number of border colors assigned to a cell * * @param row * @param col */ public int getNumBorderColors(int row, int col) { return getNumBorderColors(new CellAddress(row, col)); }
@Override public final String toString() { CellAddress crA = new CellAddress(_firstRow, _firstCol); CellAddress crB = new CellAddress(_lastRow, _lastCol); return getClass().getName() + " [" + crA.formatAsString() + ":" + crB.formatAsString() +"]"; }
/** * Retrieves the border style for a given cell * * @param row * @param col * @param property */ public BorderStyle getBorderStyle(int row, int col, String property) { return getBorderStyle(new CellAddress(row, col), property); }
/** * Retrieves the border style for a given cell * * @param row * @param col * @param property */ public short getTemplateProperty(int row, int col, String property) { return getTemplateProperty(new CellAddress(row, col), property); }
/** * Get a Hyperlink in this sheet anchored at row, column * * @param row The row where the hyperlink is anchored * @param column The column where the hyperlinkn is anchored * @return hyperlink if there is a hyperlink anchored at row, column; otherwise returns null */ @Override public XSSFHyperlink getHyperlink(int row, int column) { return getHyperlink(new CellAddress(row, column)); }
@Override public CellAddress getAddress() { return new CellAddress(_comment.getRef()); }
@Override public void setAddress(int row, int col) { setAddress(new CellAddress(row, col)); }
/** * Create a PropertyTemplate object from another PropertyTemplate * * @param template a PropertyTemplate object */ public PropertyTemplate(PropertyTemplate template) { this(); for(Map.Entry<CellAddress, Map<String, Object>> entry : template.getTemplate().entrySet()) { _propertyTemplate.put(new CellAddress(entry.getKey()), cloneCellProperties(entry.getValue())); } }
/** * {@inheritDoc} */ @Override public CellAddress getActiveCell() { int row = _sheet.getActiveCellRow(); int col = _sheet.getActiveCellCol(); return new CellAddress(row, col); }
/** * Return location of the active cell, e.g. <code>A1</code>. * * @return the location of the active cell. */ @Override public CellAddress getActiveCell() { final CTSelection sts = getSheetTypeSelection(false); final String address = (sts != null) ? sts.getActiveCell() : null; return (address != null) ? new CellAddress(address) : null; }
/** * Refresh Map<CellAddress, CTComment> commentRefs cache, * Calls that use the commentRefs cache will perform in O(1) * time rather than O(n) lookup time for List<CTComment> comments. */ private void prepareCTCommentCache() { // Create the cache if needed if(commentRefs == null) { commentRefs = new HashMap<>(); for (CTComment comment : comments.getCommentList().getCommentArray()) { commentRefs.put(new CellAddress(comment.getRef()), comment); } } }
/** * Returns cell comment associated with this cell * * @return the cell comment associated with this cell or <code>null</code> */ @Override public XSSFComment getCellComment() { return getSheet().getCellComment(new CellAddress(this)); }
@Override public CellAddress getAddress() { return new CellAddress(getRow(), getColumn()); }
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); }
/** * Removes the comment for this cell, if there is one. */ @Override public void removeCellComment() { XSSFComment comment = getCellComment(); if(comment != null){ CellAddress ref = new CellAddress(getReference()); XSSFSheet sh = getSheet(); sh.getCommentsTable(false).removeComment(ref); sh.getVMLDrawing(false).removeCommentShape(getRowIndex(), getColumnIndex()); } }