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:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable
Direct Known Subclasses:
SyntaxHighlighter, SyntaxHighlighterPrism

public class BaseSyntaxHighlighter extends com.vaadin.flow.component.react.ReactAdapterComponent implements com.vaadin.flow.component.HasSize
Base class for SyntaxHighlighters
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the content of the Syntax Highlighter
    boolean
    Returns true if the showLineNumbers feature is enabled More info: https://github.com/react-syntax-highlighter/react-syntax-highlighter?tab=readme-ov-file#props
    boolean
    Returns true if the wrapLongLines feature is enabled More info: https://github.com/react-syntax-highlighter/react-syntax-highlighter?tab=readme-ov-file#props
    void
    setContent(String content)
    Sets the content of the Syntax Highlighter
    void
    setHeight(String height)
    Obtains the width of the Syntax Highlighter
    void
    setShowLineNumbers(boolean showLineNumbers)
    Enable or disable the showLineNumbers feature
    void
    Sets the width of the Syntax Highlighter
    void
    setWrapLongLines(boolean wrapLongLines)
    Enable or disable the wrapLongLines feature

    Methods inherited from class com.vaadin.flow.component.react.ReactAdapterComponent

    addStateChangeListener, addStateChangeListener, getState, getState, readFromJson, readFromJson, setState, writeAsJson

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • 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 com.vaadin.flow.component.HasSize
    • setHeight

      public void setHeight(String height)
      Obtains the width of the Syntax Highlighter
      Specified by:
      setHeight in interface com.vaadin.flow.component.HasSize