gpt4 book ai didi

org.apache.poi.xssf.usermodel.XSSFHyperlink.getCellRef()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 07:33:05 26 4
gpt4 key购买 nike

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

XSSFHyperlink.getCellRef介绍

[英]Get the reference of the cell this applies to, es A55
[中]获取适用于es A55的单元格的引用

代码示例

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

/**
 * 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;
}

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

/**
 * Removes a hyperlink in the collection of hyperlinks on this sheet
 *
 * @param row row index
 * @param column column index
 */
@Internal
public void removeHyperlink(int row, int column) {
  // CTHyperlinks is regenerated from scratch when writing out the spreadsheet
  // so don't worry about maintaining hyperlinks and CTHyperlinks in parallel.
  // only maintain hyperlinks
  String ref = new CellReference(row, column).formatAsString();
  for (Iterator<XSSFHyperlink> it = hyperlinks.iterator(); it.hasNext();) {
    XSSFHyperlink hyperlink = it.next();
    if (hyperlink.getCellRef().equals(ref)) {
      it.remove();
      return;
    }
  }
}

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

CellReference ref = new CellReference(link.getCellRef());
if (ref.getRow() == rownum) {
  hyperlinks.remove(link);

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

/*package*/ static void updateHyperlinks(Sheet sheet, FormulaShifter formulaShifter) {
  int sheetIndex = sheet.getWorkbook().getSheetIndex(sheet);
  List<? extends Hyperlink> hyperlinkList = sheet.getHyperlinkList();
  for (Hyperlink hyperlink : hyperlinkList) {
    XSSFHyperlink xhyperlink = (XSSFHyperlink) hyperlink;
    String cellRef = xhyperlink.getCellRef();
    CellRangeAddress cra = CellRangeAddress.valueOf(cellRef);
    CellRangeAddress shiftedRange = BaseRowColShifter.shiftRange(formulaShifter, cra, sheetIndex);
    if (shiftedRange != null && shiftedRange != cra) {
      // shiftedRange should not be null. If shiftedRange is null, that means
      // that a hyperlink wasn't deleted at the beginning of shiftRows when
      // identifying rows that should be removed because they will be overwritten
      xhyperlink.setCellReference(shiftedRange.formatAsString());
    }
  }
}

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

/**
 * 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;
}

代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev

public XSSFHyperlink getHyperlink(int row, int column) {
  String ref = new CellReference(row, column).formatAsString();
  for(XSSFHyperlink hyperlink : hyperlinks) {
    if(hyperlink.getCellRef().equals(ref)) {
      return hyperlink;
    }
  }
  return null;
}

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

/**
 * Removes a hyperlink in the collection of hyperlinks on this sheet
 *
 * @param row row index
 * @param column column index
 */
@Internal
public void removeHyperlink(int row, int column) {
  // CTHyperlinks is regenerated from scratch when writing out the spreadsheet
  // so don't worry about maintaining hyperlinks and CTHyperlinks in parallel.
  // only maintain hyperlinks
  String ref = new CellReference(row, column).formatAsString();
  for (Iterator<XSSFHyperlink> it = hyperlinks.iterator(); it.hasNext();) {
    XSSFHyperlink hyperlink = it.next();
    if (hyperlink.getCellRef().equals(ref)) {
      it.remove();
      return;
    }
  }
}

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

CellReference ref = new CellReference(link.getCellRef());
if (ref.getRow() == rownum) {
  hyperlinks.remove(link);

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

/*package*/ static void updateHyperlinks(Sheet sheet, FormulaShifter formulaShifter) {
  int sheetIndex = sheet.getWorkbook().getSheetIndex(sheet);
  List<? extends Hyperlink> hyperlinkList = sheet.getHyperlinkList();
  for (Hyperlink hyperlink : hyperlinkList) {
    XSSFHyperlink xhyperlink = (XSSFHyperlink) hyperlink;
    String cellRef = xhyperlink.getCellRef();
    CellRangeAddress cra = CellRangeAddress.valueOf(cellRef);
    CellRangeAddress shiftedRange = BaseRowColShifter.shiftRange(formulaShifter, cra, sheetIndex);
    if (shiftedRange != null && shiftedRange != cra) {
      // shiftedRange should not be null. If shiftedRange is null, that means
      // that a hyperlink wasn't deleted at the beginning of shiftRows when
      // identifying rows that should be removed because they will be overwritten
      xhyperlink.setCellReference(shiftedRange.formatAsString());
    }
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com