Namespace EasyXLS.Drawings

Class ExcelComment


public class ExcelComment extends DrawingObject2D
This class stores the comment information like text, font name, font size, font style, foreground and comment position.
  • Constructor Details

    • ExcelComment

      public ExcelComment()
      Defines an instance of the Excel comment.
    • ExcelComment

      public ExcelComment(System.String text)
      Defines an instance of the Excel comment having the specified text.
      Parameters:
      text - the text of the comment
    • ExcelComment

      public ExcelComment(System.String text, int width, int height)
      Defines an instance of the Excel comment having the specified text and size.
      Parameters:
      text - the text of the comment
      width - the comment width
      height - the comment height
    • ExcelComment

      public ExcelComment(System.String text, System.String fontName, int fontSize, bool isBold, bool isItalic, System.Drawing.Color foreground)
      Defines an instance of the Excel comment having the specified text and font settings.
      Parameters:
      text - the text of the comment
      fontName - the font name of the comment text
      fontSize - the font size of the comment text
      isBold - the bold option of the comment text
      isItalic - the italic option of the comment text
      foreground - the foreground of the comment text
  • Method Details

    • getText

      public System.String getText()
      Returns the text of the comment.
      Returns:
      the text of the comment
      See Also:
      setText(System.String)
    • setText

      public void setText(System.String text)
      Sets the text of the comment.
      Parameters:
      text - the text of the comment
      See Also:
      getText()
    • getHTMLText

      public System.String getHTMLText()
      Returns the value of the comment containing the tags used to set the rich text format in the comment. The following tags are supported: <b>, <strong>, <i>, <u>, <underline single>, <underline double>, <underline single-accounting>, <underline double-accounting>, <s>, <strike>, <sup>, <sub>, <font color= face= size=>
      Returns:
      the value of the comment containing the tags used to set the rich text format in the comment.
      See Also:
      setHTMLText(System.String)
    • setHTMLText

      public void setHTMLText(System.String text)
      Sets the value of the comment using html tags. The html tags are used to set the rich text format in the comment. The following tags are supported: <b>, <strong>, <i>, <u>, <underline single>, <underline double>, <underline single-accounting>, <underline double-accounting>, <s>, <strike>, <sup>, <sub>, <font color= face= size=>
      Parameters:
      text - the value of the cell
      See Also:
      getHTMLText()
    • IsHTMLUsed

      public bool IsHTMLUsed()
      Returns true if the comment contains rich text format.
      Returns:
      true if the comment contains rich text format.
      See Also:
      setHTMLText(System.String)
    • getFont

      public System.String getFont()
      Returns the font name of the comment text.
      Returns:
      the font name of the comment text
      See Also:
      setFont(System.String)
    • setFont

      public void setFont(System.String fontName)
      Sets the font name of the comment text.
      Parameters:
      fontName - the font name of the comment text
      See Also:
      getFont()
    • getFontSize

      public int getFontSize()
      Returns the font size of the comment text.
      Returns:
      the font size of the comment text
      See Also:
      setFontSize(int)
    • setFontSize

      public void setFontSize(int fontSize)
      Sets the font size of the comment text.
      Parameters:
      fontSize - the font size of the comment text
      See Also:
      getFontSize()
    • getForeground

      public System.Drawing.Color getForeground()
      Returns the foreground of the comment text.
      Returns:
      the foreground of the comment text
      See Also:
      setForeground(System.Drawing.Color)
    • setForeground

      public void setForeground(System.Drawing.Color color)
      Sets the foreground of the comment text.
      Parameters:
      color - the foreground of the comment text
      See Also:
      getForeground()
    • IsBold

      public bool IsBold()
      Returns the bold setting of the comment text.
      Returns:
      the bold setting of the comment text
      See Also:
      setBold(bool)
    • setBold

      public void setBold(bool isBold)
      Sets the bold option of the comment text.
      Parameters:
      isBold - the bold option of the comment text
      See Also:
      IsBold()
    • IsItalic

      public bool IsItalic()
      Returns the italic setting of the comment text.
      Returns:
      the italic setting of the comment text
      See Also:
      setItalic(bool)
    • setItalic

      public void setItalic(bool isItalic)
      Sets the italic option of the comment text.
      Parameters:
      isItalic - the italic option of the comment text
      See Also:
      IsItalic()
    • getUnderlineStyle

      public int getUnderlineStyle()
      Returns the underline style of the comment text. Possible values are available in FontSettings class.
      Returns:
      the underline style of the comment text
      See Also:
      setUnderlineStyle(int)
    • setUnderlineStyle

      public void setUnderlineStyle(int underlineStyle)
      Sets the underline style of the comment text. Possible values are available in FontSettings class.
      Parameters:
      underlineStyle - underline style of the comment text
      See Also:
      getUnderlineStyle()
    • IsStrikethrough

      public bool IsStrikethrough()
      Returns the strikethrough setting of the comment.
      Returns:
      the strikethrough setting of the comment
      See Also:
      setStrikethrough(bool)
    • setStrikethrough

      public void setStrikethrough(bool isStrikethrough)
      Sets the strikethrough option of the comment.
      Parameters:
      isStrikethrough - the strikethrough option of the comment
      See Also:
      IsStrikethrough()
    • IsSuperscript

      public bool IsSuperscript()
      Returns the superscript setting of the comment.
      Returns:
      the superscript setting of the comment
      See Also:
      setSuperscript(bool)
    • setSuperscript

      public void setSuperscript(bool isSuperscript)
      Sets the superscript option of the comment.
      Parameters:
      isSuperscript - the superscript option of the comment
      See Also:
      IsSuperscript()
    • IsSubscript

      public bool IsSubscript()
      Returns the subscript setting of the comment.
      Returns:
      the subscript setting of the comment
      See Also:
      setSubscript(bool)
    • setSubscript

      public void setSubscript(bool isSubscript)
      Sets the subscript option of the comment.
      Parameters:
      isSubscript - the subscript option of the comment
      See Also:
      IsSubscript()
    • Clone

      public ExcelComment Clone()
      Creates and returns a copy of this object.
      Returns:
      a clone of this instance.