本文整理了Java中org.apache.poi.xslf.usermodel.XSLFSheet.getRelationPartById()
方法的一些代码示例,展示了XSLFSheet.getRelationPartById()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFSheet.getRelationPartById()
方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFSheet
类名称:XSLFSheet
方法名:getRelationPartById
暂无
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public XSLFObjectData getObjectData() {
String oleRel = getCTOleObject().getId();
return getSheet().getRelationPartById(oleRel).getDocumentPart();
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public OutputStream updateObjectData(final Application application, final ObjectMetaData metaData) throws IOException {
final ObjectMetaData md = (application != null) ? application.getMetaData() : metaData;
if (md == null || md.getClassID() == null) {
throw new IllegalArgumentException("either application and/or metaData needs to be set.");
}
final XSLFSheet sheet = getSheet();
final RelationPart rp;
if (_oleObject.isSetId()) {
// object data was already set
rp = sheet.getRelationPartById(_oleObject.getId());
} else {
// object data needs to be initialized
try {
final XSLFRelation descriptor = XSLFRelation.OLE_OBJECT;
final OPCPackage pack = sheet.getPackagePart().getPackage();
int nextIdx = pack.getUnusedPartIndex(descriptor.getDefaultFileName());
rp = sheet.createRelationship(descriptor, XSLFFactory.getInstance(), nextIdx, false);
_oleObject.setId(rp.getRelationship().getId());
} catch (InvalidFormatException e) {
throw new IOException("Unable to add new ole embedding", e);
}
// setting spid only works with a vml drawing object
// oleObj.setSpid("_x0000_s"+(1025+objectIdx));
}
_oleObject.setProgId(md.getProgId());
_oleObject.setName(md.getObjectName());
return new XSLFObjectOutputStream(rp.getDocumentPart().getPackagePart(),md);
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public XSLFObjectData getObjectData() {
String oleRel = getCTOleObject().getId();
return getSheet().getRelationPartById(oleRel).getDocumentPart();
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public OutputStream updateObjectData(final Application application, final ObjectMetaData metaData) throws IOException {
final ObjectMetaData md = (application != null) ? application.getMetaData() : metaData;
if (md == null || md.getClassID() == null) {
throw new IllegalArgumentException("either application and/or metaData needs to be set.");
}
final XSLFSheet sheet = getSheet();
final RelationPart rp;
if (_oleObject.isSetId()) {
// object data was already set
rp = sheet.getRelationPartById(_oleObject.getId());
} else {
// object data needs to be initialized
try {
final XSLFRelation descriptor = XSLFRelation.OLE_OBJECT;
final OPCPackage pack = sheet.getPackagePart().getPackage();
int nextIdx = pack.getUnusedPartIndex(descriptor.getDefaultFileName());
rp = sheet.createRelationship(descriptor, XSLFFactory.getInstance(), nextIdx, false);
_oleObject.setId(rp.getRelationship().getId());
} catch (InvalidFormatException e) {
throw new IOException("Unable to add new ole embedding", e);
}
// setting spid only works with a vml drawing object
// oleObj.setSpid("_x0000_s"+(1025+objectIdx));
}
_oleObject.setProgId(md.getProgId());
_oleObject.setName(md.getObjectName());
return new XSLFObjectOutputStream(rp.getDocumentPart().getPackagePart(),md);
}
内容来源于网络,如有侵权,请联系作者删除!