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 Classes
    Modifier and Type
    Class
    Description
    static 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.shared.Registration
    addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
     
    void
     
    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
     
    void
     
    void
     
    void
     
    void
    beforeClientResponse(boolean initial)
     
    void
     
    void
     
    void
     
    protected void
    clientChanged(TransportDiff diff, TransportDoc.TransportRange selection, boolean focused)
     
    protected void
     
    int
     
     
     
     
    protected AceEditorState
     
    protected AceEditorState
    getState(boolean markAsDirty)
     
    Class<? extends String>
     
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    boolean
     
    void
    removeBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
     
    void
     
    void
    removeFocusListener(com.vaadin.event.FieldEvents.FocusListener listener)
     
    void
     
    void
    removeMarker(String markerId)
     
    void
     
    void
    Scrolls the to the given position (characters from the start of the file).
    void
    scrollToRow(int row)
    Scrolls to the given row.
    void
     
    void
    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
    Use "auto" if you want to detect font size from CSS
    void
    setHighlightActiveLine(boolean highlightActiveLine)
     
    void
    setHighlightSelectedWord(boolean highlightSelectedWord)
     
    void
     
    void
     
    void
     
    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
     
    void
    setUseSoftTabs(boolean softTabs)
     
    void
    setUseWorker(boolean useWorker)
     
    void
    setValue(String newValue)
     
    void
    setWordWrap(boolean ww)
     
    void
     

    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

      protected void doSetValue(String s)
      Specified by:
      doSetValue in class com.vaadin.ui.AbstractField<String>
    • addDiffListener

      public void addDiffListener(AceEditor.DiffListener listener)
    • addFocusListener

      public com.vaadin.shared.Registration addFocusListener(com.vaadin.event.FieldEvents.FocusListener listener)
      Specified by:
      addFocusListener in interface com.vaadin.event.FieldEvents.FocusNotifier
    • addBlurListener

      public com.vaadin.shared.Registration addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
      Specified by:
      addBlurListener in interface com.vaadin.event.FieldEvents.BlurNotifier
    • addMarker

      public String addMarker(AceMarker marker)
      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

      public void addMarkerAnnotation(AceAnnotation ann, AceMarker marker)
    • addMarkerAnnotation

      public void addMarkerAnnotation(AceAnnotation ann, String markerId)
    • addRowAnnotation

      public void addRowAnnotation(AceAnnotation ann, int row)
    • addSelectionChangeListener

      public void addSelectionChangeListener(AceEditor.SelectionChangeListener listener)
    • beforeClientResponse

      public void beforeClientResponse(boolean initial)
      Specified by:
      beforeClientResponse in interface com.vaadin.server.ClientConnector
      Overrides:
      beforeClientResponse in class com.vaadin.ui.AbstractComponent
    • clearMarkerAnnotations

      public void clearMarkerAnnotations()
    • clearMarkers

      public void clearMarkers()
    • clearRowAnnotations

      public void clearRowAnnotations()
    • getCursorPosition

      public int getCursorPosition()
    • getDoc

      public AceDoc getDoc()
    • getSelection

      public TextRange getSelection()
    • getType

      public Class<? extends String> getType()
    • removeDiffListener

      public void removeDiffListener(AceEditor.DiffListener listener)
    • removeFocusListener

      public void removeFocusListener(com.vaadin.event.FieldEvents.FocusListener listener)
    • removeBlurListener

      public void removeBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
    • removeMarker

      public void removeMarker(AceMarker marker)
    • removeMarker

      public void removeMarker(String markerId)
    • removeSelectionChangeListener

      public void removeSelectionChangeListener(AceEditor.SelectionChangeListener listener)
    • setBasePath

      public void setBasePath(String path)
    • 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 0
      col - starting from 0
    • setDoc

      public void setDoc(AceDoc doc)
    • setMode

      public void setMode(AceMode mode)
    • setMode

      public void setMode(String mode)
    • setModePath

      public void setModePath(String path)
    • 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 0
      startCol - starting from 0
      endRow - starting from 0
      endCol - 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

      public void setTheme(AceTheme theme)
    • setTheme

      public void setTheme(String theme)
    • setThemePath

      public void setThemePath(String path)
    • 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

      public void setWorkerPath(String path)
    • setFontSize

      public void setFontSize(String size)
      Use "auto" if you want to detect font size from CSS
      Parameters:
      size - auto or font size
    • getFontSize

      public String 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

      protected AceEditorState getState()
      Overrides:
      getState in class com.vaadin.ui.AbstractField<String>
    • getState

      protected AceEditorState getState(boolean markAsDirty)
      Overrides:
      getState in class com.vaadin.ui.AbstractField<String>
    • setValue

      public void setValue(String newValue)
      Specified by:
      setValue in interface com.vaadin.data.HasValue<String>
      Overrides:
      setValue in class com.vaadin.ui.AbstractField<String>
    • getValue

      public String getValue()
      Specified by:
      getValue in interface com.vaadin.data.HasValue<String>