Examples of CommentsDocument


Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

    assertEquals(2, sheetComments.findAuthor("YAA"));
    assertEquals(1, sheetComments.findAuthor("another author"));
  }

  public void testGetCellComment() throws Exception {
    CommentsDocument doc = CommentsDocument.Factory.newInstance();
    doc.setComments(CTComments.Factory.newInstance());
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
    CommentsTable sheetComments = new CommentsTable();
    sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));


    CTComments comments = sheetComments.getCTComments();
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

    assertNull(sheetComments.findCellComment("A3"));
    assertNull(sheetComments.findCellComment(2, 0));
  }

  public void testAddCellComment() throws Exception {
    CommentsDocument doc = CommentsDocument.Factory.newInstance();
    doc.setComments(CTComments.Factory.newInstance());
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    doc.save(out, POIXMLDocumentPart.DEFAULT_XML_OPTIONS);
    CommentsTable sheetComments = new CommentsTable();
    sheetComments.readFrom(new ByteArrayInputStream(out.toByteArray()));

    CTCommentList commentList = sheetComments.getCTComments().addNewCommentList();
    assertEquals(0, commentList.sizeOfCommentArray());
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

        readFrom(part.getInputStream());
    }

    public void readFrom(InputStream is) throws IOException {
        try {
            CommentsDocument doc = CommentsDocument.Factory.parse(is);
            comments = doc.getComments();
        } catch (XmlException e) {
            throw new IOException(e.getLocalizedMessage());
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

        } catch (XmlException e) {
            throw new IOException(e.getLocalizedMessage());
        }
    }
    public void writeTo(OutputStream out) throws IOException {
        CommentsDocument doc = CommentsDocument.Factory.newInstance();
        doc.setComments(comments);
        doc.save(out, DEFAULT_XML_OPTIONS);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

        readFrom(part.getInputStream());
    }

    public void readFrom(InputStream is) throws IOException {
        try {
            CommentsDocument doc = CommentsDocument.Factory.parse(is);
            comments = doc.getComments();
        } catch (XmlException e) {
            throw new IOException(e.getLocalizedMessage());
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

        } catch (XmlException e) {
            throw new IOException(e.getLocalizedMessage());
        }
    }
    public void writeTo(OutputStream out) throws IOException {
        CommentsDocument doc = CommentsDocument.Factory.newInstance();
        doc.setComments(comments);
        doc.save(out, DEFAULT_XML_OPTIONS);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

        readFrom(part.getInputStream());
    }

    public void readFrom(InputStream is) throws IOException {
        try {
            CommentsDocument doc = CommentsDocument.Factory.parse(is);
            comments = doc.getComments();
        } catch (XmlException e) {
            throw new IOException(e.getLocalizedMessage());
        }
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

        } catch (XmlException e) {
            throw new IOException(e.getLocalizedMessage());
        }
    }
    public void writeTo(OutputStream out) throws IOException {
        CommentsDocument doc = CommentsDocument.Factory.newInstance();
        doc.setComments(comments);
        doc.save(out, DEFAULT_XML_OPTIONS);
    }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

    this.comments = comments;
  }
 
  public void readFrom(InputStream is) throws IOException {
    try {
      CommentsDocument doc = CommentsDocument.Factory.parse(is);
      comments = doc.getComments();
        } catch (XmlException e) {
            throw new IOException(e.getLocalizedMessage());
        }
  }
View Full Code Here

Examples of org.openxmlformats.schemas.spreadsheetml.x2006.main.CommentsDocument

        options.setUseDefaultNamespace();
       
        // Requests use of whitespace for easier reading
        options.setSavePrettyPrint();
       
        CommentsDocument doc = CommentsDocument.Factory.newInstance(options);
        doc.setComments(comments);
        doc.save(out, options);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.