org.apache.poi.hssf.usermodel.HSSFSheet.findCellCommentLocations()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.apache.poi.hssf.usermodel.HSSFSheet.findCellCommentLocations()方法的一些代码示例,展示了HSSFSheet.findCellCommentLocations()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFSheet.findCellCommentLocations()方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFSheet
类名称:HSSFSheet
方法名:findCellCommentLocations

HSSFSheet.findCellCommentLocations介绍

[英]Finds all cell comments in this sheet and adds them to the specified locations map
[中]查找此工作表中的所有单元格注释,并将其添加到指定的位置映射中

代码示例

代码示例来源:origin: org.apache.poi/poi

  1. /**
  2. * Returns all cell comments on this sheet.
  3. * @return A map of each Comment in the sheet, keyed on the cell address where
  4. * the comment is located.
  5. */
  6. @Override
  7. public Map<CellAddress, HSSFComment> getCellComments() {
  8. HSSFPatriarch patriarch = getDrawingPatriarch();
  9. if (null == patriarch) {
  10. patriarch = createDrawingPatriarch();
  11. }
  12. Map<CellAddress, HSSFComment> locations = new TreeMap<>();
  13. findCellCommentLocations(patriarch, locations);
  14. return locations;
  15. }
  16. /**

代码示例来源:origin: org.apache.poi/poi

  1. /**
  2. * Finds all cell comments in this sheet and adds them to the specified locations map
  3. *
  4. * @param container a container that may contain HSSFComments
  5. * @param locations the map to store the HSSFComments in
  6. */
  7. private void findCellCommentLocations(HSSFShapeContainer container, Map<CellAddress, HSSFComment> locations) {
  8. for (Object object : container.getChildren()) {
  9. HSSFShape shape = (HSSFShape) object;
  10. if (shape instanceof HSSFShapeGroup) {
  11. findCellCommentLocations((HSSFShapeGroup) shape, locations);
  12. continue;
  13. }
  14. if (shape instanceof HSSFComment) {
  15. HSSFComment comment = (HSSFComment) shape;
  16. if (comment.hasPosition()) {
  17. locations.put(new CellAddress(comment.getRow(), comment.getColumn()), comment);
  18. }
  19. }
  20. }
  21. }

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. /**
  2. * Returns all cell comments on this sheet.
  3. * @return A map of each Comment in the sheet, keyed on the cell address where
  4. * the comment is located.
  5. */
  6. @Override
  7. public Map<CellAddress, HSSFComment> getCellComments() {
  8. HSSFPatriarch patriarch = getDrawingPatriarch();
  9. if (null == patriarch) {
  10. patriarch = createDrawingPatriarch();
  11. }
  12. Map<CellAddress, HSSFComment> locations = new TreeMap<>();
  13. findCellCommentLocations(patriarch, locations);
  14. return locations;
  15. }
  16. /**

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi

  1. /**
  2. * Finds all cell comments in this sheet and adds them to the specified locations map
  3. *
  4. * @param container a container that may contain HSSFComments
  5. * @param locations the map to store the HSSFComments in
  6. */
  7. private void findCellCommentLocations(HSSFShapeContainer container, Map<CellAddress, HSSFComment> locations) {
  8. for (Object object : container.getChildren()) {
  9. HSSFShape shape = (HSSFShape) object;
  10. if (shape instanceof HSSFShapeGroup) {
  11. findCellCommentLocations((HSSFShapeGroup) shape, locations);
  12. continue;
  13. }
  14. if (shape instanceof HSSFComment) {
  15. HSSFComment comment = (HSSFComment) shape;
  16. if (comment.hasPosition()) {
  17. locations.put(new CellAddress(comment.getRow(), comment.getColumn()), comment);
  18. }
  19. }
  20. }
  21. }

相关文章

HSSFSheet类方法