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
Modifier and TypeClassDescriptionstatic 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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addBlurListener
(com.vaadin.event.FieldEvents.BlurListener listener) Adds a blur listener.void
addListener
(com.vaadin.v7.data.Property.ValueChangeListener listener) Deprecated.void
addValueChangeListener
(com.vaadin.v7.data.Property.ValueChangeListener listener) Returns the font size.protected CmsCodeMirror.CodeMirrorState
getState()
getType()
getValue()
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
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
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
-
CmsCodeMirror
public CmsCodeMirror()Constructor.
-
-
Method Details
-
addBlurListener
Adds a blur listener.- Parameters:
listener
- the blur listener
-
addListener
- Specified by:
addListener
in interfacecom.vaadin.v7.data.Property.ValueChangeNotifier
- See Also:
-
Property.ValueChangeNotifier.addListener(com.vaadin.v7.data.Property.ValueChangeListener)
-
addValueChangeListener
- Specified by:
addValueChangeListener
in interfacecom.vaadin.v7.data.Property.ValueChangeNotifier
- See Also:
-
Property.ValueChangeNotifier.addValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener)
-
getFontSize
Returns the font size.- Returns:
- the font size
-
getType
- Specified by:
getType
in interfacecom.vaadin.v7.data.Property<String>
- See Also:
-
Property.getType()
-
getValue
Returns the current editor content value.- Specified by:
getValue
in interfacecom.vaadin.v7.data.Property<String>
- Returns:
- the editor content value
-
isCloseBrackets
Returns whether auto close brackets is active.- Returns:
true
if auto close brackets is active
-
isHighlighting
Returns whether highlighting is active.- Returns:
true
if highlighting is active
-
isLineWrapping
Returns whether line wrapping is active.- Returns:
true
if line wrapping is active
-
isReadOnly
- Specified by:
isReadOnly
in interfacecom.vaadin.v7.data.Property<String>
- Overrides:
isReadOnly
in classcom.vaadin.ui.AbstractComponent
- See Also:
-
AbstractComponent.isReadOnly()
-
isTabsVisible
Returns whether tabs are visible.- Returns:
true
if tabs are visible
-
registerSearchReplace
Registers the given buttons as the search and replace buttons.- Parameters:
search
- the search buttonreplace
- the replace button
-
registerUndoRedo
Registers the given buttons as undo redo buttons.- Parameters:
undo
- the undo buttonredo
- the redo button
-
removeBlurListener
Removes the given blur listener.- Parameters:
listener
- the listener to remove
-
removeListener
- Specified by:
removeListener
in interfacecom.vaadin.v7.data.Property.ValueChangeNotifier
- See Also:
-
Property.ValueChangeNotifier.removeListener(com.vaadin.v7.data.Property.ValueChangeListener)
-
removeValueChangeListener
- Specified by:
removeValueChangeListener
in interfacecom.vaadin.v7.data.Property.ValueChangeNotifier
- See Also:
-
Property.ValueChangeNotifier.removeValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener)
-
setCloseBrackets
Sets the auto close brackets feature enabled.- Parameters:
closeBrackets
-true
to auto close brackets
-
setFontSize
Sets the editor font size.- Parameters:
fontSize
- the editor font size
-
setHeight
- Specified by:
setHeight
in interfacecom.vaadin.server.Sizeable
- Overrides:
setHeight
in classcom.vaadin.ui.AbstractComponent
- See Also:
-
AbstractComponent.setHeight(float, com.vaadin.server.Sizeable.Unit)
-
setHeight
- Specified by:
setHeight
in interfacecom.vaadin.server.Sizeable
- Overrides:
setHeight
in classcom.vaadin.ui.AbstractComponent
- See Also:
-
AbstractComponent.setHeight(java.lang.String)
-
setHighlighting
Sets the language highlighting enabled.- Parameters:
highlighting
-true
to highlight
-
setLanguage
Sets the editor language.- Parameters:
codeMirrorLanguage
- the editor language
-
setLineWrapping
Sets line wrapping enabled.- Parameters:
lineWrapping
-true
to wrap lines
-
setReadOnly
- Specified by:
setReadOnly
in interfacecom.vaadin.v7.data.Property<String>
- Overrides:
setReadOnly
in classcom.vaadin.ui.AbstractComponent
- See Also:
-
AbstractComponent.setReadOnly(boolean)
-
setTabsVisible
Sets tab characters visible.- Parameters:
tabsVisible
-true
to show tab characters
-
setTheme
Sets the editor theme.- Parameters:
codeMirrorTheme
- the editor theme
-
setValue
Sets the editor content value.- Specified by:
setValue
in interfacecom.vaadin.v7.data.Property<String>
- Parameters:
value
- the content value
-
setWidth
- Specified by:
setWidth
in interfacecom.vaadin.server.Sizeable
- Overrides:
setWidth
in classcom.vaadin.ui.AbstractComponent
- See Also:
-
AbstractComponent.setWidth(float, com.vaadin.server.Sizeable.Unit)
-
setWidth
- Specified by:
setWidth
in interfacecom.vaadin.server.Sizeable
- Overrides:
setWidth
in classcom.vaadin.ui.AbstractComponent
- See Also:
-
AbstractComponent.setWidth(java.lang.String)
-
getState
- Overrides:
getState
in classcom.vaadin.ui.AbstractJavaScriptComponent
- See Also:
-
AbstractJavaScriptComponent.getState()
-
addValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener)