Class AceEditor
java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractField<String>
io.jmix.ui.widget.addon.aceeditor.AceEditor
- All Implemented Interfaces:
com.vaadin.data.HasValue<String>,com.vaadin.event.ContextClickEvent.ContextClickNotifier,com.vaadin.event.FieldEvents.BlurNotifier,com.vaadin.event.FieldEvents.FocusNotifier,com.vaadin.event.MethodEventSource,com.vaadin.server.ClientConnector,com.vaadin.server.Sizeable,com.vaadin.shared.Connector,com.vaadin.ui.Component,com.vaadin.ui.Component.Focusable,com.vaadin.ui.Component.HasContextHelp,Serializable
- Direct Known Subclasses:
JmixSourceCodeEditor
public class AceEditor
extends com.vaadin.ui.AbstractField<String>
implements com.vaadin.event.FieldEvents.BlurNotifier, com.vaadin.event.FieldEvents.FocusNotifier
AceEditor wraps an Ace code editor inside a TextField-like Vaadin component.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic interfacestatic classstatic interfacestatic classNested classes/interfaces inherited from class com.vaadin.server.AbstractClientConnector
com.vaadin.server.AbstractClientConnector.IncorrectConcurrentAccessHandlerNested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.ui.Component
com.vaadin.ui.Component.ErrorEvent, com.vaadin.ui.Component.Event, com.vaadin.ui.Component.Focusable, com.vaadin.ui.Component.HasContextHelp, com.vaadin.ui.Component.ListenerNested classes/interfaces inherited from interface com.vaadin.ui.Component.HasContextHelp
com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickEvent, com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickListenerNested classes/interfaces inherited from interface com.vaadin.data.HasValue
com.vaadin.data.HasValue.ValueChangeEvent<V extends Object>, com.vaadin.data.HasValue.ValueChangeListener<V extends Object>Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
com.vaadin.server.Sizeable.Unit -
Field Summary
Fields inherited from class com.vaadin.ui.AbstractComponent
componentErrorProvider, DESIGN_ATTR_PLAIN_TEXT, requiredErrorFields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.shared.RegistrationaddBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) voidaddDiffListener(AceEditor.DiffListener listener) com.vaadin.shared.RegistrationaddFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) Adds an ace marker.addMarker(AceRange range, String cssClass, AceMarker.Type type, boolean inFront, AceMarker.OnTextChange onChange) Adds an ace marker with a generated id.voidaddMarkerAnnotation(AceAnnotation ann, AceMarker marker) voidaddMarkerAnnotation(AceAnnotation ann, String markerId) voidaddRowAnnotation(AceAnnotation ann, int row) voidvoidbeforeClientResponse(boolean initial) voidvoidvoidprotected voidclientChanged(TransportDiff diff, TransportDoc.TransportRange selection, boolean focused) protected voiddoSetValue(String s) intgetDoc()protected AceEditorStategetState()protected AceEditorStategetState(boolean markAsDirty) getType()getValue()booleanbooleanbooleanbooleanbooleanbooleanvoidremoveBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) voidremoveDiffListener(AceEditor.DiffListener listener) voidremoveFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) voidremoveMarker(AceMarker marker) voidremoveMarker(String markerId) voidvoidscrollToPosition(int pos) Scrolls the to the given position (characters from the start of the file).voidscrollToRow(int row) Scrolls to the given row.voidsetBasePath(String path) voidsetCursorPosition(int pos) Sets the cursor position to be pos characters from the beginning of the text.voidsetCursorRowCol(int row, int col) Sets the cursor on the given row and column.voidsetDisplayIndentGuides(boolean displayIndentGuides) voidvoidsetFontSize(String size) Use "auto" if you want to detect font size from CSSvoidsetHighlightActiveLine(boolean highlightActiveLine) voidsetHighlightSelectedWord(boolean highlightSelectedWord) voidvoidvoidsetModePath(String path) voidsetSelection(int start, int end) Sets the selection to be between characters [start,end).voidsetSelectionRowCol(int startRow, int startCol, int endRow, int endCol) Sets the selection to be between the given (startRow,startCol) and (endRow, endCol).voidsetShowGutter(boolean showGutter) voidsetShowInvisibles(boolean showInvisibles) voidsetShowPrintMargin(boolean showPrintMargin) voidsetTabSize(int size) voidvoidvoidsetThemePath(String path) voidsetUseSoftTabs(boolean softTabs) voidsetUseWorker(boolean useWorker) voidvoidsetWordWrap(boolean ww) voidsetWorkerPath(String path) Methods inherited from class com.vaadin.ui.AbstractField
addValueChangeListener, createValueChange, focus, getCustomAttributes, getTabIndex, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, readDesign, setReadOnly, setRequiredIndicatorVisible, setTabIndex, setValue, writeDesignMethods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addContextHelpIconClickListener, addListener, addShortcutListener, addStyleName, attach, detach, ensureContextHelpInitialized, findAncestor, fireComponentErrorEvent, fireComponentEvent, fireContextHelpClick, getActionManager, getCaption, getComponentError, getComponentErrorProvider, getContextHelpText, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getJTestId, getLocale, getParent, getPrimaryStyleName, getRequiredError, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isContextHelpTextHtmlEnabled, isEnabled, isOrHasAncestor, isResponsive, isVisible, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setComponentErrorProvider, setContextHelpText, setContextHelpTextHtmlEnabled, setData, setDebugId, setDescription, setDescription, setEnabled, setHeight, setHeight, setHeightFull, setHeightUndefined, setIcon, setId, setJTestId, setLocale, setParent, setPrimaryStyleName, setRequiredError, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidth, setWidth, setWidthFull, setWidthUndefinedMethods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getIncorrectConcurrentAccessHandler, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setConnectorResource, setErrorHandler, setIncorrectConcurrentAccessHandler, setResource, updateDiffstateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerMethods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, addStyleNames, attach, getCaption, getDescription, getIcon, getId, getJTestId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isVisible, removeListener, removeStyleName, removeStyleNames, setCaption, setEnabled, setIcon, setId, setJTestId, setParent, setPrimaryStyleName, setStyleName, setStyleName, setVisibleMethods inherited from interface com.vaadin.shared.Connector
getConnectorIdMethods inherited from interface com.vaadin.data.HasValue
clear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmptyMethods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefined
-
Constructor Details
-
AceEditor
public AceEditor()
-
-
Method Details
-
doSetValue
- Specified by:
doSetValuein classcom.vaadin.ui.AbstractField<String>
-
addDiffListener
-
addFocusListener
public com.vaadin.shared.Registration addFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) - Specified by:
addFocusListenerin interfacecom.vaadin.event.FieldEvents.FocusNotifier
-
addBlurListener
public com.vaadin.shared.Registration addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) - Specified by:
addBlurListenerin interfacecom.vaadin.event.FieldEvents.BlurNotifier
-
addMarker
Adds an ace marker. The id of the marker must be unique within this editor.- Parameters:
marker-- Returns:
- marker id
-
addMarker
public String addMarker(AceRange range, String cssClass, AceMarker.Type type, boolean inFront, AceMarker.OnTextChange onChange) Adds an ace marker with a generated id. The id is unique within this editor.- Parameters:
range-cssClass-type-inFront-onChange-- Returns:
- marker id
-
addMarkerAnnotation
-
addMarkerAnnotation
-
addRowAnnotation
-
addSelectionChangeListener
-
beforeClientResponse
public void beforeClientResponse(boolean initial) - Specified by:
beforeClientResponsein interfacecom.vaadin.server.ClientConnector- Overrides:
beforeClientResponsein classcom.vaadin.ui.AbstractComponent
-
clearMarkerAnnotations
public void clearMarkerAnnotations() -
clearMarkers
public void clearMarkers() -
clearRowAnnotations
public void clearRowAnnotations() -
getCursorPosition
public int getCursorPosition() -
getDoc
-
getSelection
-
getType
-
removeDiffListener
-
removeFocusListener
public void removeFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) -
removeBlurListener
public void removeBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) -
removeMarker
-
removeMarker
-
removeSelectionChangeListener
-
setBasePath
-
setCursorPosition
public void setCursorPosition(int pos) Sets the cursor position to be pos characters from the beginning of the text.- Parameters:
pos-
-
setCursorRowCol
public void setCursorRowCol(int row, int col) Sets the cursor on the given row and column.- Parameters:
row- starting from 0col- starting from 0
-
setDoc
-
setMode
-
setMode
-
setModePath
-
setSelection
public void setSelection(int start, int end) Sets the selection to be between characters [start,end). The cursor will be at the end.- Parameters:
start-end-
-
setSelectionRowCol
public void setSelectionRowCol(int startRow, int startCol, int endRow, int endCol) Sets the selection to be between the given (startRow,startCol) and (endRow, endCol). The cursor will be at the end.- Parameters:
startRow- starting from 0startCol- starting from 0endRow- starting from 0endCol- starting from 0
-
scrollToRow
public void scrollToRow(int row) Scrolls to the given row. First row is 0. -
scrollToPosition
public void scrollToPosition(int pos) Scrolls the to the given position (characters from the start of the file). -
setTheme
-
setTheme
-
setThemePath
-
setUseWorker
public void setUseWorker(boolean useWorker) -
setWordWrap
public void setWordWrap(boolean ww) -
setShowGutter
public void setShowGutter(boolean showGutter) -
isShowGutter
public boolean isShowGutter() -
setShowPrintMargin
public void setShowPrintMargin(boolean showPrintMargin) -
isShowPrintMargin
public boolean isShowPrintMargin() -
setHighlightActiveLine
public void setHighlightActiveLine(boolean highlightActiveLine) -
isHighlightActiveLine
public boolean isHighlightActiveLine() -
setWorkerPath
-
setFontSize
Use "auto" if you want to detect font size from CSS- Parameters:
size- auto or font size
-
getFontSize
-
setHighlightSelectedWord
public void setHighlightSelectedWord(boolean highlightSelectedWord) -
isHighlightSelectedWord
public boolean isHighlightSelectedWord() -
setShowInvisibles
public void setShowInvisibles(boolean showInvisibles) -
isShowInvisibles
public boolean isShowInvisibles() -
setDisplayIndentGuides
public void setDisplayIndentGuides(boolean displayIndentGuides) -
isDisplayIndentGuides
public boolean isDisplayIndentGuides() -
setTabSize
public void setTabSize(int size) -
setUseSoftTabs
public void setUseSoftTabs(boolean softTabs) -
clientChanged
protected void clientChanged(TransportDiff diff, TransportDoc.TransportRange selection, boolean focused) -
getState
- Overrides:
getStatein classcom.vaadin.ui.AbstractField<String>
-
getState
- Overrides:
getStatein classcom.vaadin.ui.AbstractField<String>
-
setValue
-
getValue
- Specified by:
getValuein interfacecom.vaadin.data.HasValue<String>
-