public class ExcelComment extends Object implements com.gembox.spreadsheet.internal.ExcelEditor<com.gembox.spreadsheet.internal.ExcelCommentData>, com.gembox.spreadsheet.internal.inlinestyles.FormattedStringProvider
ExcelCell.setComment(com.gembox.spreadsheet.ExcelComment)
in the worksheet.
Supported only in xlsx and xls.
Following code demonstrates how to use comments. It shows next features:
excelFile.getWorksheet(0).getCell(0, 0).getComment().setText("comment1");
excelFile.getWorksheet(0).getCell(0, 0).getComment().setVisible(false);
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Determines whether the specified
Object is equal to this ExcelComment instance. |
boolean |
exists()
If comment exists returns true, otherwise returns false.
|
String |
getAuthor()
Gets comment author.
|
AnchorCell |
getBottomRightCell()
Gets the bottom right anchor cell for the comment shape.
|
FormattedCharacterRange |
getCharacters(int startIndex)
Returns a
FormattedCharacterRange object that represents a range of characters within the comment text. |
FormattedCharacterRange |
getCharacters(int startIndex,
int length)
Returns a
FormattedCharacterRange object that represents a range of characters within the comment text. |
String |
getText()
Gets the comment text assigned to excel cell
|
AnchorCell |
getTopLeftCell()
Gets the top left anchor cell for the comment shape.
|
int |
hashCode()
Returns a hash code for this
ExcelComment instance. |
boolean |
isVisible()
Gets a value indicating whether this instance is visible.
|
void |
setAuthor(String author)
Sets comment author.
|
void |
setBottomRightCell(AnchorCell anchorCell)
Sets the bottom right anchor cell for the comment shape.
|
void |
setText(String text)
Sets the comment text assigned to excel cell
|
void |
setTopLeftCell(AnchorCell anchorCell)
Sets the top left anchor cell for the comment shape.
|
void |
setVisible(boolean isVisible)
Sets a value indicating whether this instance is visible.
|
getClass, notify, notifyAll, toString, wait, wait, wait
public boolean equals(Object obj)
Object
is equal to this ExcelComment
instance.equals
in class Object
obj
- The Object
to compare with this ExcelComment
instance.true
if the specified Object
is a ExcelComment
and is equal to this ExcelComment
instance; otherwise, false
.public final boolean exists()
public final String getAuthor()
public final AnchorCell getBottomRightCell()
public final FormattedCharacterRange getCharacters(int startIndex)
FormattedCharacterRange
object that represents a range of characters within the comment text.
The range starts at a specified character position.
Supported in XLSX only.
startIndex
- The zero-based starting character position.FormattedCharacterRange
object.IndexOutOfBoundsException
- Argument startIndex
is less than zero or is equal to or greater than 32767.public final FormattedCharacterRange getCharacters(int startIndex, int length)
FormattedCharacterRange
object that represents a range of characters within the comment text.
The range starts at a specified character position and has a specified length.
Supported in XLSX only.
getCharacters
in interface com.gembox.spreadsheet.internal.inlinestyles.FormattedStringProvider
startIndex
- The zero-based starting character position.length
- The number of characters.FormattedCharacterRange
object.IndexOutOfBoundsException
- Argument startIndex
is less than zero or is equal to or greater than 32767.IndexOutOfBoundsException
- Argument length
is equal to or less than zero or is greater than 32767.public final String getText()
public final AnchorCell getTopLeftCell()
public int hashCode()
ExcelComment
instance.hashCode
in class Object
ExcelComment
instance.public final boolean isVisible()
true
if this instance is visible; otherwise, false
.public final void setAuthor(String author)
author
- Comment author.public final void setBottomRightCell(AnchorCell anchorCell)
public final void setText(String text)
text
- The comment text assigned to excel cell.public final void setTopLeftCell(AnchorCell anchorCell)
public final void setVisible(boolean isVisible)
isVisible
- true
if this instance is visible; otherwise, false
.© GemBox Ltd. — All rights reserved.