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
Modifier and TypeClassDescriptionstatic class
static interface
static class
static interface
static class
Nested classes/interfaces inherited from class com.vaadin.server.AbstractClientConnector
com.vaadin.server.AbstractClientConnector.IncorrectConcurrentAccessHandler
Nested 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.DetachListener
Nested 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.Listener
Nested classes/interfaces inherited from interface com.vaadin.ui.Component.HasContextHelp
com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickEvent, com.vaadin.ui.Component.HasContextHelp.ContextHelpIconClickListener
Nested 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, requiredError
Fields 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
-
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.shared.Registration
addBlurListener
(com.vaadin.event.FieldEvents.BlurListener listener) void
addDiffListener
(AceEditor.DiffListener listener) com.vaadin.shared.Registration
addFocusListener
(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.void
addMarkerAnnotation
(AceAnnotation ann, AceMarker marker) void
addMarkerAnnotation
(AceAnnotation ann, String markerId) void
addRowAnnotation
(AceAnnotation ann, int row) void
void
beforeClientResponse
(boolean initial) void
void
void
protected void
clientChanged
(TransportDiff diff, TransportDoc.TransportRange selection, boolean focused) protected void
doSetValue
(String s) int
getDoc()
protected AceEditorState
getState()
protected AceEditorState
getState
(boolean markAsDirty) getType()
getValue()
boolean
boolean
boolean
boolean
boolean
boolean
void
removeBlurListener
(com.vaadin.event.FieldEvents.BlurListener listener) void
removeDiffListener
(AceEditor.DiffListener listener) void
removeFocusListener
(com.vaadin.event.FieldEvents.FocusListener listener) void
removeMarker
(AceMarker marker) void
removeMarker
(String markerId) void
void
scrollToPosition
(int pos) Scrolls the to the given position (characters from the start of the file).void
scrollToRow
(int row) Scrolls to the given row.void
setBasePath
(String path) void
setCursorPosition
(int pos) Sets the cursor position to be pos characters from the beginning of the text.void
setCursorRowCol
(int row, int col) Sets the cursor on the given row and column.void
setDisplayIndentGuides
(boolean displayIndentGuides) void
void
setFontSize
(String size) Use "auto" if you want to detect font size from CSSvoid
setHighlightActiveLine
(boolean highlightActiveLine) void
setHighlightSelectedWord
(boolean highlightSelectedWord) void
void
void
setModePath
(String path) void
setSelection
(int start, int end) Sets the selection to be between characters [start,end).void
setSelectionRowCol
(int startRow, int startCol, int endRow, int endCol) Sets the selection to be between the given (startRow,startCol) and (endRow, endCol).void
setShowGutter
(boolean showGutter) void
setShowInvisibles
(boolean showInvisibles) void
setShowPrintMargin
(boolean showPrintMargin) void
setTabSize
(int size) void
void
void
setThemePath
(String path) void
setUseSoftTabs
(boolean softTabs) void
setUseWorker
(boolean useWorker) void
void
setWordWrap
(boolean ww) void
setWorkerPath
(String path) Methods inherited from class com.vaadin.ui.AbstractField
addValueChangeListener, createValueChange, focus, getCustomAttributes, getTabIndex, isDifferentValue, isReadOnly, isRequiredIndicatorVisible, readDesign, setReadOnly, setRequiredIndicatorVisible, setTabIndex, setValue, writeDesign
Methods 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, setWidthUndefined
Methods 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, updateDiffstate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods 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, setErrorHandler
Methods 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, setVisible
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
Methods inherited from interface com.vaadin.data.HasValue
clear, getDefaultValidator, getEmptyValue, getOptionalValue, isEmpty
Methods 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:
doSetValue
in classcom.vaadin.ui.AbstractField<String>
-
addDiffListener
-
addFocusListener
public com.vaadin.shared.Registration addFocusListener(com.vaadin.event.FieldEvents.FocusListener listener) - Specified by:
addFocusListener
in interfacecom.vaadin.event.FieldEvents.FocusNotifier
-
addBlurListener
public com.vaadin.shared.Registration addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) - Specified by:
addBlurListener
in 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:
beforeClientResponse
in interfacecom.vaadin.server.ClientConnector
- Overrides:
beforeClientResponse
in 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:
getState
in classcom.vaadin.ui.AbstractField<String>
-
getState
- Overrides:
getState
in classcom.vaadin.ui.AbstractField<String>
-
setValue
-
getValue
- Specified by:
getValue
in interfacecom.vaadin.data.HasValue<String>
-