本文整理了Java中org.apache.poi.xslf.usermodel.XSLFSlide.getRelations()
方法的一些代码示例,展示了XSLFSlide.getRelations()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XSLFSlide.getRelations()
方法的具体详情如下:
包路径:org.apache.poi.xslf.usermodel.XSLFSlide
类名称:XSLFSlide
方法名:getRelations
暂无
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public XSLFNotes getNotes() {
if(_notes == null) {
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFNotes){
_notes = (XSLFNotes)p;
}
}
}
if(_notes == null) {
// This slide lacks notes
// Not all have them, sorry...
return null;
}
return _notes;
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* @return the comments part or {@code null} if there weren't any comments
* @since POI 4.0.0
*/
@SuppressWarnings("WeakerAccess")
public XSLFComments getCommentsPart() {
if(_comments == null) {
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFComments) {
_comments = (XSLFComments)p;
break;
}
}
}
return _comments;
}
代码示例来源:origin: org.apache.poi/poi-ooxml
@Override
public XSLFSlideLayout getSlideLayout(){
if(_layout == null){
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFSlideLayout){
_layout = (XSLFSlideLayout)p;
}
}
}
if(_layout == null) {
throw new IllegalArgumentException("SlideLayout was not found for " + this);
}
return _layout;
}
代码示例来源:origin: org.apache.poi/poi-ooxml
/**
* @return the comment authors part or {@code null} if there weren't any comments
* @since POI 4.0.0
*/
@SuppressWarnings("WeakerAccess")
public XSLFCommentAuthors getCommentAuthorsPart() {
if(_commentAuthors == null) {
// first scan the slide relations
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFCommentAuthors) {
_commentAuthors = (XSLFCommentAuthors)p;
return _commentAuthors;
}
}
// then scan the presentation relations
for (POIXMLDocumentPart p : getSlideShow().getRelations()) {
if (p instanceof XSLFCommentAuthors) {
_commentAuthors = (XSLFCommentAuthors)p;
return _commentAuthors;
}
}
}
return null;
}
代码示例来源:origin: org.apache.poi/poi-ooxml
public XSLFSlide removeSlide(int index) {
XSLFSlide slide = _slides.remove(index);
removeRelation(slide);
_presentation.getSldIdLst().removeSldId(index);
for (POIXMLDocumentPart p : slide.getRelations()) {
if (p instanceof XSLFChart) {
XSLFChart chart = (XSLFChart) p;
slide.removeChartRelation(chart);
_charts.remove(chart);
} else if (p instanceof XSLFSlideLayout) {
XSLFSlideLayout layout = (XSLFSlideLayout) p;
slide.removeLayoutRelation(layout);
}
}
return slide;
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public XSLFComments getComments() {
if(_comments == null) {
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFComments) {
_comments = (XSLFComments)p;
}
}
}
if(_comments == null) {
// This slide lacks comments
// Not all have them, sorry...
return null;
}
return _comments;
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public XSLFNotes getNotes() {
if(_notes == null) {
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFNotes){
_notes = (XSLFNotes)p;
}
}
}
if(_notes == null) {
// This slide lacks notes
// Not all have them, sorry...
return null;
}
return _notes;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* @return the comments part or {@code null} if there weren't any comments
* @since POI 4.0.0
*/
@SuppressWarnings("WeakerAccess")
public XSLFComments getCommentsPart() {
if(_comments == null) {
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFComments) {
_comments = (XSLFComments)p;
break;
}
}
}
return _comments;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public XSLFNotes getNotes() {
if(_notes == null) {
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFNotes){
_notes = (XSLFNotes)p;
}
}
}
if(_notes == null) {
// This slide lacks notes
// Not all have them, sorry...
return null;
}
return _notes;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
@Override
public XSLFSlideLayout getSlideLayout(){
if(_layout == null){
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFSlideLayout){
_layout = (XSLFSlideLayout)p;
}
}
}
if(_layout == null) {
throw new IllegalArgumentException("SlideLayout was not found for " + this);
}
return _layout;
}
代码示例来源:origin: org.apache.poi/poi-examples
private static XSLFChart findChart(XSLFSlide slide) {
// find chart in the slide
XSLFChart chart = null;
for(POIXMLDocumentPart part : slide.getRelations()){
if(part instanceof XSLFChart){
chart = (XSLFChart) part;
break;
}
}
if(chart == null) {
throw new IllegalStateException("chart not found in the template");
}
return chart;
}
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
public XSLFSlideLayout getSlideLayout(){
if(_layout == null){
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFSlideLayout){
_layout = (XSLFSlideLayout)p;
}
}
}
if(_layout == null) {
throw new IllegalArgumentException("SlideLayout was not found for " + this.toString());
}
return _layout;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* @return the comment authors part or {@code null} if there weren't any comments
* @since POI 4.0.0
*/
@SuppressWarnings("WeakerAccess")
public XSLFCommentAuthors getCommentAuthorsPart() {
if(_commentAuthors == null) {
// first scan the slide relations
for (POIXMLDocumentPart p : getRelations()) {
if (p instanceof XSLFCommentAuthors) {
_commentAuthors = (XSLFCommentAuthors)p;
return _commentAuthors;
}
}
// then scan the presentation relations
for (POIXMLDocumentPart p : getSlideShow().getRelations()) {
if (p instanceof XSLFCommentAuthors) {
_commentAuthors = (XSLFCommentAuthors)p;
return _commentAuthors;
}
}
}
return null;
}
代码示例来源:origin: stackoverflow.com
private XSLFChart getChartObject(XSLFSlide mainSlide,String chartName) throws IOException
{
XSLFChart chart = null;
for(POIXMLDocumentPart part : mainSlide.getRelations()){
if(part instanceof XSLFChart){
chart = (XSLFChart) part;
if(chart.getCTChart().getTitle()!=null && chart.getCTChart().getTitle().getTx()!=null){
if(chart.getCTChart().getTitle().getTx().getRich().getPList().get(0).getRList().get(0).getT().equals(chartName))
break;
}
}
}
return chart;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
public XSLFSlide removeSlide(int index) {
XSLFSlide slide = _slides.remove(index);
removeRelation(slide);
_presentation.getSldIdLst().removeSldId(index);
for (POIXMLDocumentPart p : slide.getRelations()) {
if (p instanceof XSLFChart) {
XSLFChart chart = (XSLFChart) p;
slide.removeChartRelation(chart);
_charts.remove(chart);
} else if (p instanceof XSLFSlideLayout) {
XSLFSlideLayout layout = (XSLFSlideLayout) p;
slide.removeLayoutRelation(layout);
}
}
return slide;
}
代码示例来源:origin: org.apache.poi/poi-examples
for (POIXMLDocumentPart part : slide.getRelations()) {
if (part instanceof XSLFChart) {
chart = (XSLFChart) part;
内容来源于网络,如有侵权,请联系作者删除!