Class BaseSyntaxHighlighter

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.react.ReactAdapterComponent
com.flowingcode.vaadin.addons.syntaxhighlighter.BaseSyntaxHighlighter
All Implemented Interfaces:
AttachNotifier, DetachNotifier, HasElement, HasSize, HasStyle, Serializable
Direct Known Subclasses:
SyntaxHighlighter, SyntaxHighlighterPrism

public class BaseSyntaxHighlighter extends ReactAdapterComponent implements HasSize
Base class for SyntaxHighlighters
See Also:
  • Constructor Details

    • BaseSyntaxHighlighter

      public BaseSyntaxHighlighter()
  • Method Details

    • isWrapLongLines

      public boolean isWrapLongLines()
      Returns true if the wrapLongLines feature is enabled More info: https://github.com/react-syntax-highlighter/react-syntax-highlighter?tab=readme-ov-file#props
      Returns:
      true if the wrapLongLines feature is enabled
    • setWrapLongLines

      public void setWrapLongLines(boolean wrapLongLines)
      Enable or disable the wrapLongLines feature
      Parameters:
      wrapLongLines - boolean to enable or disable the wrapLongLines feature
    • isShowLineNumbers

      public boolean isShowLineNumbers()
      Returns true if the showLineNumbers feature is enabled More info: https://github.com/react-syntax-highlighter/react-syntax-highlighter?tab=readme-ov-file#props
      Returns:
      true if the showLineNumbers feature is enabled
    • setShowLineNumbers

      public void setShowLineNumbers(boolean showLineNumbers)
      Enable or disable the showLineNumbers feature
      Parameters:
      showLineNumbers - boolean to enable or disable the showLineNumbers feature
    • getContent

      public String getContent()
      Returns the content of the Syntax Highlighter
      Returns:
      string with the contents
    • setContent

      public void setContent(String content)
      Sets the content of the Syntax Highlighter
      Parameters:
      content -
    • setWidth

      public void setWidth(String width)
      Sets the width of the Syntax Highlighter
      Specified by:
      setWidth in interface HasSize
    • setHeight

      public void setHeight(String height)
      Obtains the width of the Syntax Highlighter
      Specified by:
      setHeight in interface HasSize