com.aspose.cells

Class Comment

  • java.lang.Object
    • com.aspose.cells.Comment
public class Comment 
extends java.lang.Object

Encapsulates the object that represents a cell comment.

Example:

Workbook workbook = new Workbook();
CommentCollection comments = workbook.getWorksheets().get(0).getComments();

//Add comment to cell A1
int commentIndex = comments.add(0, 0);
Comment comment = comments.get(commentIndex);
comment.setNote("First note.");
comment.getFont().setName("Times New Roman");

//Add comment to cell B2
comments.add("B2");
comment = comments.get("B2");
comment.setNote("Second note.");

Property Getters/Setters Summary
java.lang.StringgetAuthor()
void
setAuthor(java.lang.Stringvalue)
           Gets and sets Name of the original comment author
booleangetAutoSize()
void
setAutoSize(booleanvalue)
           Indicates if size of comment is adjusted automatically according to its content.
intgetColumn()
Gets the column index of the comment.
CommentShapegetCommentShape()
Get a Shape object that represents the shape attached to the specified comment.
FontgetFont()
Gets the font of comment.
intgetHeight()
void
setHeight(intvalue)
           Represents the Height of the comment, in unit of pixels.
doublegetHeightCM()
void
setHeightCM(doublevalue)
           Represents the height of the comment, in unit of centimeters.
doublegetHeightInch()
void
setHeightInch(doublevalue)
           Represents the height of the comment, in unit of inches.
java.lang.StringgetHtmlNote()
void
setHtmlNote(java.lang.Stringvalue)
           Gets and sets the html string which contains data and some formats in this comment.
booleanisVisible()
void
setVisible(booleanvalue)
           Represents if the comment is visible or not.
java.lang.StringgetNote()
void
setNote(java.lang.Stringvalue)
           Represents the content of comment.
intgetRow()
Gets the row index of the comment.
intgetTextHorizontalAlignment()
void
           Gets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer constant.
intgetTextOrientationType()
void
           Gets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constant.
intgetTextVerticalAlignment()
void
           Gets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer constant.
ThreadedCommentCollectiongetThreadedComments()
Gets the list of threaded comments;
intgetWidth()
void
setWidth(intvalue)
           Represents the width of the comment, in unit of pixels.
doublegetWidthCM()
void
setWidthCM(doublevalue)
           Represents the width of the comment, in unit of centimeters.
doublegetWidthInch()
void
setWidthInch(doublevalue)
           Represents the width of the comment, in unit of inches.
 
Method Summary
FontSettingcharacters(int startIndex, int length)
Returns a Characters object that represents a range of characters within the comment text.
voidformatCharacters(int startIndex, int length, Font font, StyleFlag flag)
Format some chararcters with the font setting.
java.util.ArrayListgetCharacters()
Returns all Characters objects that represents a range of characters within the comment text.
 

    • Property Getters/Setters Detail

      • getAuthor/setAuthor

        public java.lang.String getAuthor() / public void setAuthor(java.lang.String value)
        
        Gets and sets Name of the original comment author
      • getCommentShape

        public CommentShape getCommentShape()
        
        Get a Shape object that represents the shape attached to the specified comment.
      • getRow

        public int getRow()
        
        Gets the row index of the comment.
      • getColumn

        public int getColumn()
        
        Gets the column index of the comment.
      • getNote/setNote

        public java.lang.String getNote() / public void setNote(java.lang.String value)
        
        Represents the content of comment.
      • getHtmlNote/setHtmlNote

        public java.lang.String getHtmlNote() / public void setHtmlNote(java.lang.String value)
        
        Gets and sets the html string which contains data and some formats in this comment.
      • getFont

        public Font getFont()
        
        Gets the font of comment.
      • isVisible/setVisible

        public boolean isVisible() / public void setVisible(boolean value)
        
        Represents if the comment is visible or not.
      • getTextOrientationType/setTextOrientationType

        public int getTextOrientationType() / public void setTextOrientationType(int value)
        
        Gets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constant.
      • getTextHorizontalAlignment/setTextHorizontalAlignment

        public int getTextHorizontalAlignment() / public void setTextHorizontalAlignment(int value)
        
        Gets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer constant.
      • getTextVerticalAlignment/setTextVerticalAlignment

        public int getTextVerticalAlignment() / public void setTextVerticalAlignment(int value)
        
        Gets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer constant.
      • getAutoSize/setAutoSize

        public boolean getAutoSize() / public void setAutoSize(boolean value)
        
        Indicates if size of comment is adjusted automatically according to its content.
      • getHeightCM/setHeightCM

        public double getHeightCM() / public void setHeightCM(double value)
        
        Represents the height of the comment, in unit of centimeters.
      • getWidthCM/setWidthCM

        public double getWidthCM() / public void setWidthCM(double value)
        
        Represents the width of the comment, in unit of centimeters.
      • getWidth/setWidth

        public int getWidth() / public void setWidth(int value)
        
        Represents the width of the comment, in unit of pixels.
      • getHeight/setHeight

        public int getHeight() / public void setHeight(int value)
        
        Represents the Height of the comment, in unit of pixels.
      • getWidthInch/setWidthInch

        public double getWidthInch() / public void setWidthInch(double value)
        
        Represents the width of the comment, in unit of inches.
      • getHeightInch/setHeightInch

        public double getHeightInch() / public void setHeightInch(double value)
        
        Represents the height of the comment, in unit of inches.

    setAuthor

    public voidsetAuthor(java.lang.Stringvalue)
    
    Gets and sets Name of the original comment author

    setNote

    public voidsetNote(java.lang.Stringvalue)
    
    Represents the content of comment.

    setHtmlNote

    public voidsetHtmlNote(java.lang.Stringvalue)
    
    Gets and sets the html string which contains data and some formats in this comment.

    setVisible

    public voidsetVisible(booleanvalue)
    
    Represents if the comment is visible or not.

    setTextOrientationType

    public voidsetTextOrientationType(intvalue)
    
    Gets and sets the text orientation type of the comment. The value of the property is TextOrientationType integer constant.

    setTextHorizontalAlignment

    public voidsetTextHorizontalAlignment(intvalue)
    
    Gets and sets the text horizontal alignment type of the comment. The value of the property is TextAlignmentType integer constant.

    setTextVerticalAlignment

    public voidsetTextVerticalAlignment(intvalue)
    
    Gets and sets the text vertical alignment type of the comment. The value of the property is TextAlignmentType integer constant.

    setAutoSize

    public voidsetAutoSize(booleanvalue)
    
    Indicates if size of comment is adjusted automatically according to its content.

    setHeightCM

    public voidsetHeightCM(doublevalue)
    
    Represents the height of the comment, in unit of centimeters.

    setWidthCM

    public voidsetWidthCM(doublevalue)
    
    Represents the width of the comment, in unit of centimeters.

    setWidth

    public voidsetWidth(intvalue)
    
    Represents the width of the comment, in unit of pixels.

    setHeight

    public voidsetHeight(intvalue)
    
    Represents the Height of the comment, in unit of pixels.

    setWidthInch

    public voidsetWidthInch(doublevalue)
    
    Represents the width of the comment, in unit of inches.

    setHeightInch

    public voidsetHeightInch(doublevalue)
    
    Represents the height of the comment, in unit of inches.
    • Method Detail

      • formatCharacters

        public void formatCharacters(int startIndex, int length, Font font, StyleFlag flag)
        Format some chararcters with the font setting.
        Parameters:
        startIndex - The start index.
        length - The the length.
        font - The font setting.
        flag - The flag of the font setting.
      • characters

        public FontSetting characters(int startIndex, int length)
        Returns a Characters object that represents a range of characters within the comment text.
        Parameters:
        startIndex - The index of the start of the character.
        length - The number of characters.
        Returns:
        Characters object.
      • getCharacters

        public java.util.ArrayList getCharacters()
        Returns all Characters objects that represents a range of characters within the comment text.
        Returns:
        All Characters objects