本文整理了Java中org.apache.poi.ss.usermodel.Cell.getHyperlink()
方法的一些代码示例,展示了Cell.getHyperlink()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Cell.getHyperlink()
方法的具体详情如下:
包路径:org.apache.poi.ss.usermodel.Cell
类名称:Cell
方法名:getHyperlink
暂无
代码示例来源:origin: org.apache.poi/poi-ooxml
final Hyperlink srcHyperlink = (srcCell == null) ? null : srcCell.getHyperlink();
代码示例来源:origin: com.helger/ph-poi
@Nullable
public static Hyperlink getHyperlink (@Nullable final Cell aCell)
{
return aCell == null ? null : aCell.getHyperlink ();
}
代码示例来源:origin: com.phloc/phloc-poi
@Nullable
public static Hyperlink getHyperlink (@Nullable final Cell aCell)
{
return aCell == null ? null : aCell.getHyperlink ();
}
代码示例来源:origin: tobyweston/simple-excel
private static void copyCellHyperlink(Cell oldCell, Cell newCell) {
if (oldCell.getHyperlink() != null)
newCell.setHyperlink(oldCell.getHyperlink());
}
代码示例来源:origin: stackoverflow.com
Workbook wb = WorkbookFactory.create(new File(FilePath));
Sheet TestSheet = wb.getSheetAt(0);
Cell cell = TestSheet.getRow(0).getCell(0);
Hyperlink linkAddress = cell.getHyperlink();
if(linkAddress != null){
System.out.println(linkAddress .getAddress());
}
代码示例来源:origin: stackoverflow.com
Workbook wb = WorkbookFactory.create(new File("test.xls"));
Sheet s = wb.getSheetAt(0);
Row r2 = s.getRow(1); // Rows in POI are 0 based
Cell cB2 = r2.getCell(1); // Cells are 0 based
Hyperlink h = cB2.getHyperlink();
if (h == null) {
System.err.println("Cell B2 didn't have a hyperlink!");
} else {
System.out.println("B2 : " + h.getLabel() + " -> " + h.getAddress());
}
代码示例来源:origin: tobyweston/simple-excel
@Override
public Cell adapt(org.apache.poi.ss.usermodel.Cell cell) {
if (cell.getHyperlink() != null && containsUrl(cell.getHyperlink()))
return new HyperlinkCell(hyperlink(cell.getStringCellValue(), cell.getHyperlink().getAddress()));
if (cell.getStringCellValue() == null || "".equals(cell.getStringCellValue()))
return new BlankCell();
return new StringCell(cell.getStringCellValue());
}
代码示例来源:origin: com.github.nic-luo/rober-office
protected void loadAllSheet(Workbook workBook) throws ConfigException{
Sheet sheet = workBook.getSheetAt(CATALOG_SHEET_INDEX);
for(int i=CATALOG_SHEET_START_ROW;i<=sheet.getLastRowNum();i++){
Row row = sheet.getRow(i);
Cell nameCell = row.getCell(2);
Cell statusCell = row.getCell(4);
if(nameCell==null||statusCell==null)continue;
String status = StringKit.trim(statusCell.getStringCellValue());
if("已完成".equals(status)){
String catalogId = getCellStringValue(nameCell,"目录名称",4);
String sheetName = catalogId;
Hyperlink hyperlink = nameCell.getHyperlink();
if(hyperlink != null) sheetName = hyperlink.getLabel();
//如果目标sheet名称为空,则忽略,下一个
if(sheetName==null||sheetName.length()==0)continue;
//如果有超连接,则从连接上取连接到的目标sheet
loadSheetItem(workBook,sheetName,catalogId);
}
}
}
代码示例来源:origin: com.itelg/texin
if (cell.getHyperlink() != null)
return cell.getHyperlink().getAddress();
代码示例来源:origin: org.jxls/jxls-poi
private void readCellGeneralInfo(Cell cell) {
hyperlink = cell.getHyperlink();
try {
comment = cell.getCellComment();
} catch (Exception e) {
logger.error("Failed to read cell comment at " + new CellReference(cell).formatAsString(), e);
return;
}
if(comment != null ){
commentAuthor = comment.getAuthor();
}
if( comment != null && comment.getString() != null ){
String commentString = comment.getString().getString();
String[] commentLines = commentString.split("\\n");
for(String commentLine : commentLines ){
if( isJxlsParamsComment(commentLine)){
processJxlsParams(commentLine);
comment = null;
return;
}
}
setCellComment(commentString);
}
}
代码示例来源:origin: stackoverflow.com
if (oldCell.getHyperlink() != null) {
newCell.setHyperlink(oldCell.getHyperlink());
代码示例来源:origin: com.phloc/phloc-poi
if (aSource.getHyperlink () != null)
aTarget.setHyperlink (aSource.getHyperlink ());
代码示例来源:origin: hellojavaer/poi-excel-utils
String address = null;
if (cell != null) {
Hyperlink hyperlink = cell.getHyperlink();
if (hyperlink != null) {
address = hyperlink.getAddress();
代码示例来源:origin: stackoverflow.com
if (oldCell.getHyperlink() != null) {
newCell.setHyperlink(oldCell.getHyperlink());
代码示例来源:origin: micromata/projectforge
if (oldCell.getHyperlink() != null) {
newCell.setHyperlink(oldCell.getHyperlink());
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
final Hyperlink srcHyperlink = (srcCell == null) ? null : srcCell.getHyperlink();
内容来源于网络,如有侵权,请联系作者删除!