Class CmsCodeMirror

java.lang.Object
com.vaadin.server.AbstractClientConnector
com.vaadin.ui.AbstractComponent
com.vaadin.ui.AbstractJavaScriptComponent
org.opencms.ui.components.codemirror.CmsCodeMirror
All Implemented Interfaces:
com.vaadin.event.ContextClickEvent.ContextClickNotifier, com.vaadin.event.MethodEventSource, com.vaadin.server.ClientConnector, com.vaadin.server.Sizeable, com.vaadin.shared.Connector, com.vaadin.ui.Component, com.vaadin.v7.data.Property<String>, com.vaadin.v7.data.Property.ValueChangeNotifier, Serializable

@JavaScript("codemirror-connector.js") public class CmsCodeMirror extends com.vaadin.ui.AbstractJavaScriptComponent implements com.vaadin.v7.data.Property<String>, com.vaadin.v7.data.Property.ValueChangeNotifier
Code mirror input component.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    The available editor languages.
    static class 
    The editor state.
    static enum 
    The available editor themes.
    static class 
    The code mirror change event.

    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.Listener

    Nested classes/interfaces inherited from interface com.vaadin.v7.data.Property

    com.vaadin.v7.data.Property.Editor, com.vaadin.v7.data.Property.ReadOnlyException, com.vaadin.v7.data.Property.ReadOnlyStatusChangeEvent, com.vaadin.v7.data.Property.ReadOnlyStatusChangeListener, com.vaadin.v7.data.Property.ReadOnlyStatusChangeNotifier, com.vaadin.v7.data.Property.Transactional<T extends Object>, com.vaadin.v7.data.Property.ValueChangeListener, com.vaadin.v7.data.Property.ValueChangeNotifier, com.vaadin.v7.data.Property.Viewer

    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

    DESIGN_ATTR_PLAIN_TEXT

    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
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
    Adds a blur listener.
    void
    addListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
    void
    addValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
     
    Returns the font size.
     
    Class<? extends String>
     
    Returns the current editor content value.
    boolean
    Returns whether auto close brackets is active.
    boolean
    Returns whether highlighting is active.
    boolean
    Returns whether line wrapping is active.
    boolean
     
    boolean
    Returns whether tabs are visible.
    void
    registerSearchReplace(com.vaadin.ui.Button search, com.vaadin.ui.Button replace)
    Registers the given buttons as the search and replace buttons.
    void
    registerUndoRedo(com.vaadin.ui.Button undo, com.vaadin.ui.Button redo)
    Registers the given buttons as undo redo buttons.
    void
    removeBlurListener(com.vaadin.event.FieldEvents.BlurNotifier listener)
    Removes the given blur listener.
    void
    removeListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
    void
    removeValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
     
    void
    setCloseBrackets(boolean closeBrackets)
    Sets the auto close brackets feature enabled.
    void
    setFontSize(String fontSize)
    Sets the editor font size.
    void
    setHeight(float height, com.vaadin.server.Sizeable.Unit unit)
     
    void
    setHeight(String height)
     
    void
    setHighlighting(boolean highlighting)
    Sets the language highlighting enabled.
    void
    Sets the editor language.
    void
    setLineWrapping(boolean lineWrapping)
    Sets line wrapping enabled.
    void
    setReadOnly(boolean readOnly)
     
    void
    setTabsVisible(boolean tabsVisible)
    Sets tab characters visible.
    void
    Sets the editor theme.
    void
    Sets the editor content value.
    void
    setWidth(float width, com.vaadin.server.Sizeable.Unit unit)
     
    void
     

    Methods inherited from class com.vaadin.ui.AbstractJavaScriptComponent

    addFunction, callFunction, getState, registerRpc

    Methods inherited from class com.vaadin.ui.AbstractComponent

    addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isOrHasAncestor, isRequiredIndicatorVisible, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setDescription, setEnabled, setHeightFull, setHeightUndefined, setIcon, setId, setLocale, setParent, setPrimaryStyleName, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setVisible, setWidthFull, setWidthUndefined, writeDesign

    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, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, 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, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler

    Methods inherited from interface com.vaadin.ui.Component

    addStyleNames, getUI, removeStyleNames, setStyleName

    Methods inherited from interface com.vaadin.shared.Connector

    getConnectorId
  • Constructor Details

  • Method Details

    • addBlurListener

      public void addBlurListener(com.vaadin.event.FieldEvents.BlurListener listener)
      Adds a blur listener.

      Parameters:
      listener - the blur listener
    • addListener

      @Deprecated public void addListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
      Specified by:
      addListener in interface com.vaadin.v7.data.Property.ValueChangeNotifier
      See Also:
      • Property.ValueChangeNotifier.addListener(com.vaadin.v7.data.Property.ValueChangeListener)
    • addValueChangeListener

      public void addValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
      Specified by:
      addValueChangeListener in interface com.vaadin.v7.data.Property.ValueChangeNotifier
      See Also:
      • Property.ValueChangeNotifier.addValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener)
    • getFontSize

      public String getFontSize()
      Returns the font size.

      Returns:
      the font size
    • getType

      public Class<? extends String> getType()
      Specified by:
      getType in interface com.vaadin.v7.data.Property<String>
      See Also:
      • Property.getType()
    • getValue

      public String getValue()
      Returns the current editor content value.

      Specified by:
      getValue in interface com.vaadin.v7.data.Property<String>
      Returns:
      the editor content value
    • isCloseBrackets

      public boolean isCloseBrackets()
      Returns whether auto close brackets is active.

      Returns:
      true if auto close brackets is active
    • isHighlighting

      public boolean isHighlighting()
      Returns whether highlighting is active.

      Returns:
      true if highlighting is active
    • isLineWrapping

      public boolean isLineWrapping()
      Returns whether line wrapping is active.

      Returns:
      true if line wrapping is active
    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface com.vaadin.v7.data.Property<String>
      Overrides:
      isReadOnly in class com.vaadin.ui.AbstractComponent
      See Also:
      • AbstractComponent.isReadOnly()
    • isTabsVisible

      public boolean isTabsVisible()
      Returns whether tabs are visible.

      Returns:
      true if tabs are visible
    • registerSearchReplace

      public void registerSearchReplace(com.vaadin.ui.Button search, com.vaadin.ui.Button replace)
      Registers the given buttons as the search and replace buttons.

      Parameters:
      search - the search button
      replace - the replace button
    • registerUndoRedo

      public void registerUndoRedo(com.vaadin.ui.Button undo, com.vaadin.ui.Button redo)
      Registers the given buttons as undo redo buttons.

      Parameters:
      undo - the undo button
      redo - the redo button
    • removeBlurListener

      public void removeBlurListener(com.vaadin.event.FieldEvents.BlurNotifier listener)
      Removes the given blur listener.

      Parameters:
      listener - the listener to remove
    • removeListener

      @Deprecated public void removeListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
      Specified by:
      removeListener in interface com.vaadin.v7.data.Property.ValueChangeNotifier
      See Also:
      • Property.ValueChangeNotifier.removeListener(com.vaadin.v7.data.Property.ValueChangeListener)
    • removeValueChangeListener

      public void removeValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener listener)
      Specified by:
      removeValueChangeListener in interface com.vaadin.v7.data.Property.ValueChangeNotifier
      See Also:
      • Property.ValueChangeNotifier.removeValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener)
    • setCloseBrackets

      public void setCloseBrackets(boolean closeBrackets)
      Sets the auto close brackets feature enabled.

      Parameters:
      closeBrackets - true to auto close brackets
    • setFontSize

      public void setFontSize(String fontSize)
      Sets the editor font size.

      Parameters:
      fontSize - the editor font size
    • setHeight

      public void setHeight(float height, com.vaadin.server.Sizeable.Unit unit)
      Specified by:
      setHeight in interface com.vaadin.server.Sizeable
      Overrides:
      setHeight in class com.vaadin.ui.AbstractComponent
      See Also:
      • AbstractComponent.setHeight(float, com.vaadin.server.Sizeable.Unit)
    • setHeight

      public void setHeight(String height)
      Specified by:
      setHeight in interface com.vaadin.server.Sizeable
      Overrides:
      setHeight in class com.vaadin.ui.AbstractComponent
      See Also:
      • AbstractComponent.setHeight(java.lang.String)
    • setHighlighting

      public void setHighlighting(boolean highlighting)
      Sets the language highlighting enabled.

      Parameters:
      highlighting - true to highlight
    • setLanguage

      public void setLanguage(CmsCodeMirror.CodeMirrorLanguage codeMirrorLanguage)
      Sets the editor language.

      Parameters:
      codeMirrorLanguage - the editor language
    • setLineWrapping

      public void setLineWrapping(boolean lineWrapping)
      Sets line wrapping enabled.

      Parameters:
      lineWrapping - true to wrap lines
    • setReadOnly

      public void setReadOnly(boolean readOnly)
      Specified by:
      setReadOnly in interface com.vaadin.v7.data.Property<String>
      Overrides:
      setReadOnly in class com.vaadin.ui.AbstractComponent
      See Also:
      • AbstractComponent.setReadOnly(boolean)
    • setTabsVisible

      public void setTabsVisible(boolean tabsVisible)
      Sets tab characters visible.

      Parameters:
      tabsVisible - true to show tab characters
    • setTheme

      public void setTheme(CmsCodeMirror.CodeMirrorTheme codeMirrorTheme)
      Sets the editor theme.

      Parameters:
      codeMirrorTheme - the editor theme
    • setValue

      public void setValue(String value)
      Sets the editor content value.

      Specified by:
      setValue in interface com.vaadin.v7.data.Property<String>
      Parameters:
      value - the content value
    • setWidth

      public void setWidth(float width, com.vaadin.server.Sizeable.Unit unit)
      Specified by:
      setWidth in interface com.vaadin.server.Sizeable
      Overrides:
      setWidth in class com.vaadin.ui.AbstractComponent
      See Also:
      • AbstractComponent.setWidth(float, com.vaadin.server.Sizeable.Unit)
    • setWidth

      public void setWidth(String width)
      Specified by:
      setWidth in interface com.vaadin.server.Sizeable
      Overrides:
      setWidth in class com.vaadin.ui.AbstractComponent
      See Also:
      • AbstractComponent.setWidth(java.lang.String)
    • getState

      Overrides:
      getState in class com.vaadin.ui.AbstractJavaScriptComponent
      See Also:
      • AbstractJavaScriptComponent.getState()