public class CommentCollection extends CollectionBase
Comment objects.
Example
Workbook workbook = new Workbook();
CommentCollection comments = workbook.getWorksheets().get(0).getComments();
//do your business
| Modifier and Type | Method and Description |
|---|---|
int |
add(int row,
int column)
Adds a comment to the collection.
|
int |
add(java.lang.String cellName)
Adds a comment to the collection.
|
int |
addThreadedComment(int row,
int column,
java.lang.String text,
ThreadedCommentAuthor author)
Adds a threaded comment.
|
int |
addThreadedComment(java.lang.String cellName,
java.lang.String text,
ThreadedCommentAuthor author)
Adds a threaded comment.
|
void |
clear()
Removes all comments;
|
Comment |
get(int index)
Gets the
Comment element at the specified index. |
Comment |
get(int row,
int column)
Gets the
Comment element at the specified row index and column index. |
Comment |
get(java.lang.String cellName)
Gets the
Comment element at the specified cell. |
ThreadedCommentCollection |
getThreadedComments(int row,
int column)
Gets the threaded comments by row and column index.
|
ThreadedCommentCollection |
getThreadedComments(java.lang.String cellName)
Gets the threaded comments by cell name.
|
void |
removeAt(int row,
int column)
Removes the comment of the specific cell.
|
void |
removeAt(java.lang.String cellName)
Removes the comment of the specific cell.
|
public int addThreadedComment(int row,
int column,
java.lang.String text,
ThreadedCommentAuthor author)
row - Cell row index.column - Cell column index.text - The text of the commentauthor - The user of this threaded comment.ThreadedComment object index.public int addThreadedComment(java.lang.String cellName,
java.lang.String text,
ThreadedCommentAuthor author)
cellName - The name of the cell.text - The text of the commentauthor - The user of this threaded comment.ThreadedComment object index.public ThreadedCommentCollection getThreadedComments(int row, int column)
Example
ThreadedCommentCollection threadedComments1 = comments.getThreadedComments(1, 1);
for (int i = 0; i <threadedComments1.getCount(); ++i)
{
ThreadedComment tc = threadedComments1.get(i);
String note = tc.getNotes();
}
row - The row index.column - The column index.public ThreadedCommentCollection getThreadedComments(java.lang.String cellName)
Example
ThreadedCommentCollection threadedComments2 = comments.getThreadedComments("B2");
for (int i = 0; i <threadedComments2.getCount(); ++i)
{
ThreadedComment tc = threadedComments2.get(i);
String note = tc.getNotes();
}
cellName - The name of the cell.public int add(int row,
int column)
Example
int commentIndex1 = comments.add(0, 0);
Comment comment1 = comments.get(commentIndex1);
comment1.setNote("First note.");
comment1.getFont().setName("Times New Roman");
row - Cell row index.column - Cell column index.Comment object index.public int add(java.lang.String cellName)
Example
int commentIndex2 = comments.add("B2");
Comment comment2 = comments.get(commentIndex2);
comment2.setNote("Second note.");
comment2.getFont().setName("Times New Roman");
cellName - Cell name.Comment object index.public Comment get(int index)
Comment element at the specified index.
Example
Comment comment3 = comments.get(0);
comment3.setNote("Three note.");
get in class CollectionBaseindex - The zero based index of the element.public Comment get(java.lang.String cellName)
Comment element at the specified cell.
Example
Comment comment4 = comments.get("B2");
comment4.setNote("Four note.");
cellName - Cell name.public Comment get(int row, int column)
Comment element at the specified row index and column index.
Example
Comment comment5 = comments.get(1,1);
comment5.setNote("Five note.");
row - Row index.column - Column index.public void removeAt(java.lang.String cellName)
Example
comments.removeAt("B2");
cellName - The name of cell which contains a comment.public void removeAt(int row,
int column)
Example
comments.removeAt(1,1);
row - The row index.column - the column index.public void clear()
Example
comments.clear();
clear in class CollectionBaseSee Also:
Aspose.Cells Documentation - the home page for the Aspose.Cells Product Documentation.
Aspose.Cells Support Forum - our preferred method of support.
We guarantee a prompt response to any inquiry!
© Aspose Pty Ltd 2003-2025. All Rights Reserved.