Class BaseMarkdownComponent
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.react.ReactAdapterComponent
com.flowingcode.vaadin.addons.markdown.BaseMarkdownComponent
- All Implemented Interfaces:
AttachNotifier,DetachNotifier,HasElement,HasSize,HasStyle,Serializable
- Direct Known Subclasses:
MarkdownEditor,MarkdownViewer
@CssImport("./styles/markdown-editor-styles.css")
@NpmPackage(value="mermaid",version="11.2.1") @NpmPackage(value="@uiw/react-md-editor",version="4.0.4") @NpmPackage(value="dompurify",version="3.1.6")
public class BaseMarkdownComponent
extends ReactAdapterComponent
implements HasSize
Base class for Markdown based Components.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the color schemes for the Markdown component. -
Constructor Summary
ConstructorsConstructorDescriptionBaseMarkdownComponent(String content) Base constructor that receives the content of the markdown component. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddContentChangeListener(SerializableConsumer<String> listener) Adds the specified listener for the content change event.Sets the content of the Markdown component.voidsetContent(String content) Gets the content of the Markdown component.voidSets the color mode of the Markdown component.Methods 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, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
-
Constructor Details
-
BaseMarkdownComponent
Base constructor that receives the content of the markdown component.- Parameters:
content- content to be used in the Markdown component
-
-
Method Details
-
getContent
Sets the content of the Markdown component.- Returns:
- the content of the Markdown component
-
setContent
Gets the content of the Markdown component.- Parameters:
content- retrieved from the state of the component
-
addContentChangeListener
Adds the specified listener for the content change event.- Parameters:
listener- the listener callback for receiving content changes
-
setDataColorMode
Sets the color mode of the Markdown component.- Parameters:
mode- the color mode of the component
-