org.apache.poi.ss.usermodel.Hyperlink.setLabel()方法的使用及代码示例

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

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

Hyperlink.setLabel介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

if ( link.startsWith( "http:" ) || link.startsWith( "https:" ) || link.startsWith( "ftp:" ) ) {
 hyperLink = ch.createHyperlink( HyperlinkType.URL );
 hyperLink.setLabel( "URL Link" );
} else if ( link.startsWith( "mailto:" ) ) {
 hyperLink = ch.createHyperlink( HyperlinkType.EMAIL );
 hyperLink.setLabel( "Email Link" );
} else if ( link.startsWith( "'" ) ) {
 hyperLink = ch.createHyperlink( HyperlinkType.DOCUMENT );
 hyperLink.setLabel( "Link within this document" );
} else {
 hyperLink = ch.createHyperlink( HyperlinkType.FILE );
 hyperLink.setLabel( "Link to a file" );

代码示例来源:origin: stackoverflow.com

Hyperlink hyperlink = creationHelper.createHyperlink(Hyperlink.LINK_FILE);
String relativePath = "../parentdir/fileToLink.txt";
hyperlink.setAddress(relativePath);
hyperlink.setLabel("Link to file");
cell.setHyperlink(hyperlink);
cell.setCellValue("Link to file");
cell.setCellType(Cell.CELL_TYPE_STRING);

代码示例来源:origin: com.b2international.snowowl/com.b2international.snowowl.datastore.server

/**
 * Creates the index sheet based on the given sheet names.
 * 
 * @param sheetNames
 */
protected void createIndexSheet(final Collection<T> components) {
  final Sheet indexSheet = workbook.createSheet("INDEX");
  final List<T> filteredComponents = Lists.newArrayList(Iterables.filter(components, new Predicate<T>() {
    @Override
    public boolean apply(T input) {
      return isToExport(getComponentId(input));
    }
  }));
  final List<String> sheetNames = extractSheetNamesFromTerminologyComponents(filteredComponents);
  final Row firstRow = indexSheet.createRow(0);
  createCell(firstRow, getIndexSheetHeaderName(), BOLD_STYLE, 0);
  for (int i = 0; i < sheetNames.size(); i++) {
    final String sheetName = getFinalSheetName(i + 1, sheetNames.get(i));
    final Hyperlink hyperlink = workbook.getCreationHelper().createHyperlink(XSSFHyperlink.LINK_DOCUMENT);
    hyperlink.setLabel(sheetName);
    hyperlink.setAddress(String.format("'%s'!A1", sheetName));
    final Row row = indexSheet.createRow(i + 1);
    final Cell cell = row.createCell(0);
    cell.setCellValue(sheetName);
    cell.setCellStyle(hyperlinkStyle);
    cell.setHyperlink(hyperlink);
  }
  indexSheet.autoSizeColumn(0);
}

代码示例来源:origin: Appendium/objectlabkit

public ExcelCell link(String url, String label) {
  final CreationHelper creationHelper = row().sheet().workbook().poiWorkbook().getCreationHelper();
  final Hyperlink hl = creationHelper.createHyperlink(HyperlinkType.URL);
  hl.setAddress(url);
  hl.setLabel(label);
  currentCell.setCellValue(label);
  currentCell.setHyperlink(hl);
  style(LINK);
  return this;
}

相关文章