Class JmixCodeEditor
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.AbstractField<C,T>
 
com.vaadin.flow.component.AbstractSinglePropertyField<JmixCodeEditor,String>
 
io.jmix.flowui.kit.component.codeeditor.JmixCodeEditor
- All Implemented Interfaces:
- com.vaadin.flow.component.AttachNotifier,- com.vaadin.flow.component.BlurNotifier<JmixCodeEditor>,- com.vaadin.flow.component.CompositionNotifier,- com.vaadin.flow.component.DetachNotifier,- com.vaadin.flow.component.Focusable<JmixCodeEditor>,- com.vaadin.flow.component.FocusNotifier<JmixCodeEditor>,- com.vaadin.flow.component.HasElement,- com.vaadin.flow.component.HasEnabled,- com.vaadin.flow.component.HasHelper,- com.vaadin.flow.component.HasLabel,- com.vaadin.flow.component.HasSize,- com.vaadin.flow.component.HasStyle,- com.vaadin.flow.component.HasValidation,- com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCodeEditor,,- String>, - String> - com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCodeEditor,,- String>, - String> - com.vaadin.flow.component.InputNotifier,- com.vaadin.flow.component.KeyNotifier,- com.vaadin.flow.component.shared.HasClientValidation,- com.vaadin.flow.component.shared.HasTooltip,- com.vaadin.flow.component.shared.HasValidationProperties,- com.vaadin.flow.data.binder.HasValidator<String>,- HasTitle,- Serializable
- Direct Known Subclasses:
- CodeEditor
@Tag("jmix-code-editor")
@NpmPackage(value="ace-builds",
            version="1.18.0")
@JsModule("./src/code-editor/jmix-code-editor.js")
public class JmixCodeEditor
extends com.vaadin.flow.component.AbstractSinglePropertyField<JmixCodeEditor,String>
implements com.vaadin.flow.component.CompositionNotifier, com.vaadin.flow.component.Focusable<JmixCodeEditor>, com.vaadin.flow.component.shared.HasClientValidation, com.vaadin.flow.component.HasHelper, com.vaadin.flow.component.HasLabel, HasTitle, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.shared.HasTooltip, com.vaadin.flow.component.shared.HasValidationProperties, com.vaadin.flow.data.binder.HasValidator<String>, com.vaadin.flow.component.InputNotifier, com.vaadin.flow.component.KeyNotifier 
- See Also:
- 
Nested Class SummaryNested ClassesNested classes/interfaces inherited from class com.vaadin.flow.component.AbstractFieldcom.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V extends Object> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifiercom.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifiercom.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.shared.HasClientValidationcom.vaadin.flow.component.shared.HasClientValidation.ClientValidatedEventNested classes/interfaces inherited from interface com.vaadin.flow.component.HasValuecom.vaadin.flow.component.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>>
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final intprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected CodeEditorValidationSupport
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddValidationStatusChangeListener(com.vaadin.flow.data.binder.ValidationStatusChangeListener<String> listener) com.vaadin.flow.data.binder.Validator<String>getMode()intgetTheme()protected CodeEditorValidationSupportprotected voidhandleValueChanged(boolean isFromClient, String newValue) protected voidbooleanbooleanbooleanDetermines whether the field is marked as input required.booleanbooleanbooleanbooleanbooleanprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidvoidsetFontSize(String fontSize) Sets the font size for code in the editor.voidsetHighlightActiveLine(boolean highlightActiveLine) Sets the highlight of the active line.voidsetHighlightGutterLine(boolean highlightGutterLine) Sets the highlight of the current gutter line.voidsetMode(CodeEditorMode mode) Sets syntax highlighting for a specific mode.protected voidsetPresentationValue(String newPresentationValue) voidsetPrintMarginColumn(int printMarginColumn) Sets the column for the vertical line, which shows the limit on the length of a line of code.voidsetRequired(boolean required) Specifies that the user must fill in a value.voidsetRequiredIndicatorVisible(boolean requiredIndicatorVisible) voidsetShowGutter(boolean showGutter) Sets the visibility of the gutter.voidsetShowLineNumbers(boolean showLineNumbers) Sets the line numbers visibility.voidsetShowPrintMargin(boolean showPrintMargin) Sets the visibility of the vertical line that shows the limit on the length of a line of code.voidsetTextWrap(boolean textWrap) Sets the text content wrapping mode.voidsetTheme(CodeEditorTheme theme) Sets the visual theme of the editor.voidsetUseSoftTabs(boolean useSoftTabs) Sets the tab character representing mode.protected voidvalidate()Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyFieldgetSynchronizationRegistration, hasValidValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractFieldaddValueChangeListener, getValue, isEmpty, setModelValue, setValue, valueEqualsMethods inherited from class com.vaadin.flow.component.ComponentaddListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifieraddAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifieraddBlurListenerMethods inherited from interface com.vaadin.flow.component.CompositionNotifieraddCompositionEndListener, addCompositionStartListener, addCompositionUpdateListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifieraddDetachListenerMethods inherited from interface com.vaadin.flow.component.FocusableaddFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifieraddFocusListenerMethods inherited from interface com.vaadin.flow.component.shared.HasClientValidationaddClientValidatedEventListenerMethods inherited from interface com.vaadin.flow.component.HasElementgetElementMethods inherited from interface com.vaadin.flow.component.HasEnabledisEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelpergetHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasLabelgetLabel, setLabelMethods inherited from interface com.vaadin.flow.component.HasSizegetHeight, 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.HasStyleaddClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.shared.HasTooltipgetTooltip, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValidationsetManualValidationMethods inherited from interface com.vaadin.flow.component.shared.HasValidationPropertiesgetErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.component.HasValueclear, getOptionalValueMethods inherited from interface com.vaadin.flow.component.HasValueAndElementisReadOnly, isRequiredIndicatorVisible, setReadOnlyMethods inherited from interface com.vaadin.flow.component.InputNotifieraddInputListenerMethods inherited from interface com.vaadin.flow.component.KeyNotifieraddKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListener
- 
Field Details- 
CODE_EDITOR_VALUE_CHANGED_EVENT- See Also:
 
- 
PROPERTY_THEME_CHANGED_EVENT- See Also:
 
- 
PROPERTY_VALUE- See Also:
 
- 
PROPERTY_THEME- See Also:
 
- 
PROPERTY_MODE- See Also:
 
- 
PROPERTY_HIGHLIGHT_ACTIVE_LINE- See Also:
 
- 
PROPERTY_HIGHLIGHT_GUTTER_LINE- See Also:
 
- 
PROPERTY_SHOW_GUTTER- See Also:
 
- 
PROPERTY_SHOW_LINE_NUMBERS- See Also:
 
- 
PROPERTY_SHOW_PRINT_MARGIN- See Also:
 
- 
PROPERTY_PRINT_MARGIN_COLUMN- See Also:
 
- 
PROPERTY_FONT_SIZE- See Also:
 
- 
PROPERTY_TEXT_WRAP- See Also:
 
- 
PROPERTY_USE_SOFT_TABS- See Also:
 
- 
PRINT_MARGIN_COLUMN_DEFAULT_VALUEprotected static final int PRINT_MARGIN_COLUMN_DEFAULT_VALUE- See Also:
 
- 
FONT_SIZE_DEFAULT_VALUE- See Also:
 
- 
validationSupport
 
- 
- 
Constructor Details- 
JmixCodeEditorpublic JmixCodeEditor()
 
- 
- 
Method Details- 
initComponentprotected void initComponent()
- 
isHighlightActiveLine@Synchronize("highlightActiveLine") public boolean isHighlightActiveLine()- Returns:
- trueif the active line highlighting is enabled,- falseotherwise
 
- 
setHighlightActiveLinepublic void setHighlightActiveLine(boolean highlightActiveLine) Sets the highlight of the active line. If the highlighting is enabled, the line the cursor is on will be highlighted. The highlight is enabled by default.- Parameters:
- highlightActiveLine- whether to use active line highlighting
 
- 
isHighlightGutterLine@Synchronize("highlightGutterLine") public boolean isHighlightGutterLine()- Returns:
- trueif the current gutter line highlighting is enabled,- falseotherwise
 
- 
setHighlightGutterLinepublic void setHighlightGutterLine(boolean highlightGutterLine) Sets the highlight of the current gutter line. If the highlighting is enabled, the gutter line the cursor is on will be highlighted. The highlight is enabled by default.- Parameters:
- highlightGutterLine- whether to use gutter line highlighting
 
- 
isShowGutter@Synchronize("showGutter") public boolean isShowGutter()- Returns:
- trueif gutter is visible,- falseotherwise
 
- 
setShowGutterpublic void setShowGutter(boolean showGutter) Sets the visibility of the gutter. The gutter is visible by default.- Parameters:
- showGutter- whether to show the gutter
 
- 
isShowLineNumbers@Synchronize("showLineNumbers") public boolean isShowLineNumbers()- Returns:
- trueif line numbers is visible,- falseotherwise
 
- 
setShowLineNumberspublic void setShowLineNumbers(boolean showLineNumbers) Sets the line numbers visibility. The line number is visible by default.- Parameters:
- showLineNumbers- whether to show the line numbers
 
- 
isShowPrintMargin@Synchronize("showPrintMargin") public boolean isShowPrintMargin()- Returns:
- trueif the print margin,- falseotherwise
 
- 
setShowPrintMarginpublic void setShowPrintMargin(boolean showPrintMargin) Sets the visibility of the vertical line that shows the limit on the length of a line of code. The print margin is visible by default.- Parameters:
- showPrintMargin- whether to show the print margin
 
- 
getPrintMarginColumn@Synchronize("printMarginColumn") public int getPrintMarginColumn()- Returns:
- print margin position in symbols
 
- 
setPrintMarginColumnpublic void setPrintMarginColumn(int printMarginColumn) Sets the column for the vertical line, which shows the limit on the length of a line of code. The print margin column is 80 by default.- Parameters:
- printMarginColumn- print margin position in symbols
 
- 
getTheme- Returns:
- current visual theme applied to the editor
 
- 
setThemeSets the visual theme of the editor. The visual theme isCodeEditorTheme.TEXTMATEby default, but if no theme is specified explicitly, the component will adapt the visual theme to the theme of the application.Thus - when using the light theme of the application, CodeEditorTheme.TEXTMATEwill be applied, when using the dark theme -CodeEditorTheme.NORD_DARKwill be applied.- Parameters:
- theme- the instance of the- CodeEditorThemeto be applied
 
- 
getMode- Returns:
- current syntax highlighting mode applied to the editor
 
- 
setModeSets syntax highlighting for a specific mode. The syntax highlighting mode isCodeEditorMode.PLAIN_TEXTby default.- Parameters:
- mode- the instance of the- CodeEditorModeto be applied
 
- 
getFontSize- Returns:
- font size for code in the editor in CSS font-size string format
 
- 
setFontSizeSets the font size for code in the editor. The font size is1remby default.- Parameters:
- fontSize- CSS font-size string
 
- 
isTextWrap@Synchronize("textWrap") public boolean isTextWrap()- Returns:
- trueif the text content inside editor should be wrapped,- falseotherwise
 
- 
setTextWrappublic void setTextWrap(boolean textWrap) Sets the text content wrapping mode. The text wrap isfalseby default.- Parameters:
- textWrap- whether to wrap text content
 
- 
isUseSoftTabs@Synchronize("useSoftTabs") public boolean isUseSoftTabs()- Returns:
- trueif tab character should be represented as spaces instead of a special- \tcharacter,- falseotherwise.
 
- 
setUseSoftTabspublic void setUseSoftTabs(boolean useSoftTabs) Sets the tab character representing mode. Soft tabs mode means that tab character will be represented as a series of spaces. Hard tabs mode means that tab character will be represented as the special\tcharacter. The soft tabs istrueby default.- Parameters:
- useSoftTabs- whether to use soft tabs
 
- 
isRequiredpublic boolean isRequired()Determines whether the field is marked as input required.- Returns:
- trueif the input is required,- falseotherwise
 
- 
setRequiredpublic void setRequired(boolean required) Specifies that the user must fill in a value.- Parameters:
- required- the boolean value to set
 
- 
setPresentationValue- Overrides:
- setPresentationValuein class- com.vaadin.flow.component.AbstractSinglePropertyField<JmixCodeEditor,- String> 
 
- 
getEmptyValue- Specified by:
- getEmptyValuein interface- com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCodeEditor,- String>, - String> 
- Overrides:
- getEmptyValuein class- com.vaadin.flow.component.AbstractField<JmixCodeEditor,- String> 
 
- 
setRequiredIndicatorVisiblepublic void setRequiredIndicatorVisible(boolean requiredIndicatorVisible) - Specified by:
- setRequiredIndicatorVisiblein interface- com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCodeEditor,- String>, - String> 
- Specified by:
- setRequiredIndicatorVisiblein interface- com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<JmixCodeEditor,- String>, - String> 
 
- 
getDefaultValidator- Specified by:
- getDefaultValidatorin interface- com.vaadin.flow.data.binder.HasValidator<String>
 
- 
addValidationStatusChangeListenerpublic com.vaadin.flow.shared.Registration addValidationStatusChangeListener(com.vaadin.flow.data.binder.ValidationStatusChangeListener<String> listener) - Specified by:
- addValidationStatusChangeListenerin interface- com.vaadin.flow.data.binder.HasValidator<String>
 
- 
validateprotected void validate()
- 
onAttachprotected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
- onAttachin class- com.vaadin.flow.component.Component
 
- 
onCodeEditorValueChangedEvent
- 
handleValueChanged
- 
getValidationSupport
 
-