org.apache.poi.xslf.usermodel.XSLFTextShape.getXmlObject()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(112)

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

XSLFTextShape.getXmlObject介绍

暂无

代码示例

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

/**
 * Copy placeholders from this layout to the destination slide
 *
 * @param slide destination slide
 */
@SuppressWarnings("WeakerAccess")
public void copyLayout(XSLFSlide slide) {
  for (XSLFShape sh : getShapes()) {
    if (sh instanceof XSLFTextShape) {
      XSLFTextShape tsh = (XSLFTextShape) sh;
      Placeholder ph = tsh.getTextType();
      if (ph == null) continue;
      switch (ph) {
        // these are special and not copied by default
        case DATETIME:
        case SLIDE_NUMBER:
        case FOOTER:
          break;
        default:
          slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy());
      }
    }
  }
}

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

@Override
public CTTableCell getXmlObject(){
  return (CTTableCell)super.getXmlObject();
}

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

public Placeholder getTextType(){
  CTPlaceholder ph;
  XmlObject[] obj = getXmlObject().selectPath(
      "declare namespace p='http://schemas.openxmlformats.org/presentationml/2006/main' .//*/p:nvPr/p:ph");
  if(obj.length == 1){
    ph = (CTPlaceholder)obj[0];
    int val = ph.getType().intValue();
    return Placeholder.values()[val - 1];
  }
  else {
    return null;
  }
}

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

/**
 * Copy placeholders from this layout to the destination slide
 *
 * @param slide destination slide
 */
@SuppressWarnings("WeakerAccess")
public void copyLayout(XSLFSlide slide) {
  for (XSLFShape sh : getShapes()) {
    if (sh instanceof XSLFTextShape) {
      XSLFTextShape tsh = (XSLFTextShape) sh;
      Placeholder ph = tsh.getTextType();
      if (ph == null) continue;
      switch (ph) {
        // these are special and not copied by default
        case DATETIME:
        case SLIDE_NUMBER:
        case FOOTER:
          break;
        default:
          slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy());
      }
    }
  }
}

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

/**
 * Copy placeholders from this layout to the destination slide
 *
 * @param slide destination slide
 */
public void copyLayout(XSLFSlide slide) {
  for (XSLFShape sh : getShapes()) {
    if (sh instanceof XSLFTextShape) {
      XSLFTextShape tsh = (XSLFTextShape) sh;
      Placeholder ph = tsh.getTextType();
      if (ph == null) continue;
      switch (ph) {
        // these are special and not copied by default
        case DATETIME:
        case SLIDE_NUMBER:
        case FOOTER:
          break;
        default:
          slide.getSpTree().addNewSp().set(tsh.getXmlObject().copy());
      }
    }
  }
}

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

/**
 * Specifies that the corresponding shape should be represented by the generating application
 * as a placeholder. When a shape is considered a placeholder by the generating application
 * it can have special properties to alert the user that they may enter content into the shape.
 * Different types of placeholders are allowed and can be specified by using the placeholder
 * type attribute for this element
 *
 * @param placeholder
 */
public void setPlaceholder(Placeholder placeholder){
  CTShape sh =  (CTShape)getXmlObject();
  CTApplicationNonVisualDrawingProps nv = sh.getNvSpPr().getNvPr();
  if(placeholder == null) {
    if(nv.isSetPh()) nv.unsetPh();
  } else {
    nv.addNewPh().setType(STPlaceholderType.Enum.forInt(placeholder.ordinal() + 1));
  }
}

相关文章