Class 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<java.lang.String>, com.vaadin.v7.data.Property.ValueChangeNotifier, java.io.Serializable

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

    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CmsCodeMirror.CodeMirrorLanguage
      The available editor languages.
      static class  CmsCodeMirror.CodeMirrorState
      The editor state.
      static class  CmsCodeMirror.CodeMirrorTheme
      The available editor themes.
      static class  CmsCodeMirror.ValueChangeEvent
      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 java.lang.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
      CmsCodeMirror()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      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)  
      java.lang.String getFontSize()
      Returns the font size.
      protected CmsCodeMirror.CodeMirrorState getState()  
      java.lang.Class<? extends java.lang.String> getType()  
      java.lang.String getValue()
      Returns the current editor content value.
      boolean isCloseBrackets()
      Returns whether auto close brackets is active.
      boolean isHighlighting()
      Returns whether highlighting is active.
      boolean isLineWrapping()
      Returns whether line wrapping is active.
      boolean isReadOnly()  
      boolean isTabsVisible()
      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​(java.lang.String fontSize)
      Sets the editor font size.
      void setHeight​(float height, com.vaadin.server.Sizeable.Unit unit)  
      void setHeight​(java.lang.String height)  
      void setHighlighting​(boolean highlighting)
      Sets the language highlighting enabled.
      void setLanguage​(CmsCodeMirror.CodeMirrorLanguage codeMirrorLanguage)
      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 setTheme​(CmsCodeMirror.CodeMirrorTheme codeMirrorTheme)
      Sets the editor theme.
      void setValue​(java.lang.String value)
      Sets the editor content value.
      void setWidth​(float width, com.vaadin.server.Sizeable.Unit unit)  
      void setWidth​(java.lang.String width)  
      • 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
    • Method Detail

      • addBlurListener

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

        Parameters:
        listener - the blur listener
      • 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 java.lang.String getFontSize()
        Returns the font size.

        Returns:
        the font size
      • getType

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

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

        Specified by:
        getValue in interface com.vaadin.v7.data.Property<java.lang.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<java.lang.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
      • 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​(java.lang.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​(java.lang.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
      • 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<java.lang.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
      • setValue

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

        Specified by:
        setValue in interface com.vaadin.v7.data.Property<java.lang.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​(java.lang.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

        protected CmsCodeMirror.CodeMirrorState getState()
        Overrides:
        getState in class com.vaadin.ui.AbstractJavaScriptComponent
        See Also:
        AbstractJavaScriptComponent.getState()