[]
Use this interface to read or modify threaded comment content, navigate between parent and reply threaded comments, and work with the replies associated with a top-level threaded comment. A threaded comment is typically created from a cell by calling IRange.addCommentThreaded(String,String) and can also be accessed from the worksheet's ICommentsThreaded collection.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Review this value", "Alex");
ICommentThreaded reply = comment.addReply("I updated the number.", "Jamie");
ICommentThreaded parent = reply.getParent();
ICommentsThreaded replies = comment.getReplies();
voiddelete()getDate()booleangetText()next()ICommentThreaded object that represents the next threaded comment.previous()ICommentThreaded object that represents the previous threaded comment.voidsetIsResolved(boolean value) voidAdds a reply to this threaded comment's replies collection if the threaded comment is a top-level threaded comment. If this threaded comment is a reply, it adds the new reply to the parent threaded comment's replies collection.
This overload forwards to addReply(String,String) with an empty author string.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
ICommentThreaded reply = comment.addReply("I updated the total.");
String replyText = reply.getText();
text - The content of the reply. Must not be null. If this value is empty or contains only whitespace, no reply is added and null is returned.null if text is empty or contains only whitespace.IllegalStateException - if this threaded comment cannot be replied to because it is resolved, or because it is a reply whose parent threaded comment is resolved.NullPointerException - if text is null.Adds the reply to this threaded comment's replies collection if this threaded comment is a top-level threaded comment. If this threaded comment is itself a reply, the new reply is added to the parent threaded comment's replies collection.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Review this value", "Alex");
ICommentThreaded reply = comment.addReply("I updated the number.", "Jamie");
String replyText = reply.getText();
text - The content of the reply. Must not be null. If this value is empty or contains only whitespace, no reply is added and null is returned.author - The author of the reply.null if text is empty or contains only whitespace.IllegalStateException - if this threaded comment cannot be replied to because it is resolved, or because it is a reply whose parent threaded comment is resolved.NullPointerException - if text is null.If this threaded comment is a reply, it deletes only itself from the parent threaded comment's reply list.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Review this value", "Alex");
comment.addReply("I updated the number.", "Jamie");
comment.delete();
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
comment.setIsResolved(true);
value - true if the threaded comment is resolved; otherwise, false.A resolved threaded comment cannot be edited or replied to. Use setIsResolved(boolean) to change the resolved status.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
comment.setIsResolved(true);
boolean resolved = comment.getIsResolved();
true if the threaded comment is resolved; otherwise, false.Returns the text content of this threaded comment, whether it is a top-level threaded comment or a reply.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
String text = comment.getText();
null if no text is set.Sets the text content of this threaded comment, whether it is a top-level threaded comment or a reply.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
comment.setText("The total has been reviewed.");
text - The text of the threaded comment; can be null.Returns a ICommentsThreaded collection that contains the ICommentThreaded objects replying to this threaded comment. The replies are sorted by time stamp. If this threaded comment is itself a reply, this method returns null.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
comment.addReply("I updated the total.", "Jamie");
comment.addReply("I verified the formula.", "Morgan");
ICommentsThreaded replies = comment.getReplies();
ICommentThreaded firstReply = replies.get(0);
null if this threaded comment is a reply.Use the returned IAuthor object to read or update the author name associated with this threaded comment.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Review this value", "Alex");
IAuthor author = comment.getAuthor();
String name = author.getName();
IAuthor object associated with the threaded comment.getLocalDateTime() instead.This method is obsolete. Use getLocalDateTime() instead.
Date object that represents the date and time when the threaded comment was added in local time.Returns a LocalDateTime value for the threaded comment in the local time zone.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Review this value", "Alex");
LocalDateTime localDateTime = comment.getLocalDateTime();
LocalDateTime value that represents the date and time when the threaded comment was added in local time. Returns null if the threaded comment does not have a date and time value.ICommentThreaded object that represents the next threaded comment.For a top-level threaded comment, this method returns the next threaded comment on the worksheet. For a reply threaded comment, this method returns the next reply in the parent threaded comment's replies collection.
ICommentThreaded first = worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
worksheet.getRange("A2").addCommentThreaded("Check the discount.", "Jamie");
ICommentThreaded nextComment = first.next();
String nextText = nextComment.getText();
ICommentThreaded object. Returns null if the top-level threaded comment is the last threaded comment on a sheet, or if the reply threaded comment is the last reply of a threaded comment's replies.ICommentThreaded object that represents the previous threaded comment.For a top-level threaded comment, this method returns the previous threaded comment on the worksheet. For a reply threaded comment, this method returns the previous reply in the parent threaded comment's replies collection.
worksheet.getRange("A1").addCommentThreaded("Please review the total.", "Alex");
ICommentThreaded comment = worksheet.getRange("A2").addCommentThreaded("Check the discount.", "Jamie");
ICommentThreaded previousComment = comment.previous();
String previousText = previousComment.getText();
ICommentThreaded object. Returns null if the top-level threaded comment is the first threaded comment on a sheet, or if the reply threaded comment is the first reply of a threaded comment's replies.The top-level threaded comment's parent is null. For a reply, this method returns the threaded comment that the reply belongs to.
ICommentThreaded comment = worksheet.getRange("A1").addCommentThreaded("Review this value", "Alex");
ICommentThreaded reply = comment.addReply("I updated the number.", "Jamie");
ICommentThreaded parent = reply.getParent();
null if this is a top-level threaded comment.
getLocalDateTime()instead.