Package org.pptx4j

Examples of org.pptx4j.Pptx4jException


   
    try {
      Relationship rel = this.addTargetPart(slidePart, AddPartBehaviour.RENAME_IF_NAME_EXISTS);
      return this.getJaxbElement().getSldIdLst().getSldId().add(createSlideIdListEntry(rel));
    } catch (InvalidFormatException e) {
      throw new Pptx4jException(e.getMessage(), e);
    }
  }
View Full Code Here


    List<SldId> sldIds = this.getJaxbElement().getSldIdLst().getSldId();
   
    int zeroBasedCount = sldIds.size();

    if (index< 0 || index>zeroBasedCount) {
      throw new Pptx4jException("Can't add slide at index " + index + ".  (There are " + sldIds.size() + " slides) ");     
    }
   
    try {
      Relationship rel = this.addTargetPart(slidePart, AddPartBehaviour.RENAME_IF_NAME_EXISTS);
      sldIds.add(index, createSlideIdListEntry(rel));
    } catch (InvalidFormatException e) {
      throw new Pptx4jException(e.getMessage(), e);
    }
  }
View Full Code Here

    List<SldId> sldIds = this.getJaxbElement().getSldIdLst().getSldId();
   
    int zeroBasedCount = sldIds.size() -1;

    if (index< 0 || index>zeroBasedCount) {
      throw new Pptx4jException("No slide at index " + index + ".  (There are " + sldIds.size() + " slides) ");     
    }
   
    Presentation.SldIdLst.SldId entry = this.getJaxbElement().getSldIdLst().getSldId().remove(index);
   
    Relationship rel = this.getRelationshipsPart().getRelationshipByID(entry.getRid());
View Full Code Here

   * @throws Pptx4jException
   * @since 3.0
   */
  public void removeSlide(Relationship rel) throws Pptx4jException {
   
    if (rel==null) throw new Pptx4jException("Null relationship.");
   
    int index = -1;
    int i=0;
    for (Presentation.SldIdLst.SldId entry : this.getJaxbElement().getSldIdLst().getSldId()) {
     
      if (entry.getRid().equals(rel.getId())) {
        index = i;
        break;
      }
      i++;
    }
   
    if (index>-1) {
      removeSlide(index);
    } else {
      throw new Pptx4jException("No slide is the target of that relationship.");
    }
  }
View Full Code Here

    List<SldId> sldIds = this.getJaxbElement().getSldIdLst().getSldId();
   
    int zeroBasedCount = sldIds.size() -1;

    if (index< 0 || index>zeroBasedCount) {
      throw new Pptx4jException("No slide at index " + index + ".  (There are " + sldIds.size() + " slides) ");     
    }

    try {
      Presentation.SldIdLst.SldId entry = this.getJaxbElement().getSldIdLst().getSldId().get(index);
      return (SlidePart)this.getRelationshipsPart().getPart(entry.getRid());
    } catch (Exception e) {
      throw new Pptx4jException("Slide " + index + " not found", e);
    }
   
  }
View Full Code Here

  }
 
  private void ensureContent() throws Pptx4jException {
    try {
      if (this.getContents()==null ) {
        throw new Pptx4jException("MainPresentationPart has no content");
      }
     
    } catch (Docx4JException e) {
      throw new Pptx4jException(e.getMessage(), e);
    }   
  }
View Full Code Here

  }

  private void ensureSldIdLst() throws Pptx4jException {
    try {
      if (this.getContents().getSldIdLst()==null) {
        throw new Pptx4jException("SldIdLst missing from MainPresentationPart");
      }
     
    } catch (Docx4JException e) {
      throw new Pptx4jException(e.getMessage(), e);
    }   
  }
View Full Code Here

TOP

Related Classes of org.pptx4j.Pptx4jException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.