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 -
Method Summary
Modifier and TypeMethodDescriptionReturns the content of the Syntax HighlighterbooleanReturns true if the showLineNumbers feature is enabled More info: https://github.com/react-syntax-highlighter/react-syntax-highlighter?tab=readme-ov-file#propsbooleanReturns true if the wrapLongLines feature is enabled More info: https://github.com/react-syntax-highlighter/react-syntax-highlighter?tab=readme-ov-file#propsvoidsetContent(String content) Sets the content of the Syntax HighlightervoidObtains the width of the Syntax HighlightervoidsetShowLineNumbers(boolean showLineNumbers) Enable or disable the showLineNumbers featurevoidSets the width of the Syntax HighlightervoidsetWrapLongLines(boolean wrapLongLines) Enable or disable the wrapLongLines featureMethods inherited from class com.vaadin.flow.component.react.ReactAdapterComponent
addStateChangeListener, addStateChangeListener, getState, getState, readFromJson, readFromJson, setState, writeAsJsonMethods 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods 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, setWidthFullMethods 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
Returns the content of the Syntax Highlighter- Returns:
- string with the contents
-
setContent
Sets the content of the Syntax Highlighter- Parameters:
content-
-
setWidth
Sets the width of the Syntax Highlighter- Specified by:
setWidthin interfacecom.vaadin.flow.component.HasSize
-
setHeight
Obtains the width of the Syntax Highlighter- Specified by:
setHeightin interfacecom.vaadin.flow.component.HasSize
-