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 ClassesModifier and TypeClassDescriptionstatic enumThe available editor languages.static classThe editor state.static enumThe available editor themes.static classThe 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.DetachListenerNested 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.ListenerNested 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>, com.vaadin.v7.data.Property.ValueChangeListener, com.vaadin.v7.data.Property.ValueChangeNotifier, com.vaadin.v7.data.Property.ViewerNested 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_TEXTFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlurListener(com.vaadin.event.FieldEvents.BlurListener listener) Adds a blur listener.voidaddListener(com.vaadin.v7.data.Property.ValueChangeListener listener) Deprecated.voidaddValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener listener) Returns the font size.protected CmsCodeMirror.CodeMirrorStategetState()getType()getValue()Returns the current editor content value.booleanReturns whether auto close brackets is active.booleanReturns whether highlighting is active.booleanReturns whether line wrapping is active.booleanbooleanReturns whether tabs are visible.voidregisterSearchReplace(com.vaadin.ui.Button search, com.vaadin.ui.Button replace) Registers the given buttons as the search and replace buttons.voidregisterUndoRedo(com.vaadin.ui.Button undo, com.vaadin.ui.Button redo) Registers the given buttons as undo redo buttons.voidremoveBlurListener(com.vaadin.event.FieldEvents.BlurNotifier listener) Removes the given blur listener.voidremoveListener(com.vaadin.v7.data.Property.ValueChangeListener listener) voidremoveValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener listener) voidsetCloseBrackets(boolean closeBrackets) Sets the auto close brackets feature enabled.voidsetFontSize(String fontSize) Sets the editor font size.voidsetHeight(float height, com.vaadin.server.Sizeable.Unit unit) voidvoidsetHighlighting(boolean highlighting) Sets the language highlighting enabled.voidsetLanguage(CmsCodeMirror.CodeMirrorLanguage codeMirrorLanguage) Sets the editor language.voidsetLineWrapping(boolean lineWrapping) Sets line wrapping enabled.voidsetReadOnly(boolean readOnly) voidsetTabsVisible(boolean tabsVisible) Sets tab characters visible.voidsetTheme(CmsCodeMirror.CodeMirrorTheme codeMirrorTheme) Sets the editor theme.voidSets the editor content value.voidsetWidth(float width, com.vaadin.server.Sizeable.Unit unit) voidMethods inherited from class com.vaadin.ui.AbstractJavaScriptComponent
addFunction, callFunction, getState, registerRpcMethods 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, writeDesignMethods 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, updateDiffstateMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlerMethods inherited from interface com.vaadin.ui.Component
addStyleNames, getUI, removeStyleNames, setStyleNameMethods 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:
addListenerin interfacecom.vaadin.v7.data.Property.ValueChangeNotifier- See Also:
-
addValueChangeListener
- Specified by:
addValueChangeListenerin interfacecom.vaadin.v7.data.Property.ValueChangeNotifier- See Also:
-
getFontSize
Returns the font size.- Returns:
- the font size
-
getType
- Specified by:
getTypein interfacecom.vaadin.v7.data.Property<String>- See Also:
-
getValue
Returns the current editor content value.- Specified by:
getValuein interfacecom.vaadin.v7.data.Property<String>- Returns:
- the editor content value
-
isCloseBrackets
Returns whether auto close brackets is active.- Returns:
trueif auto close brackets is active
-
isHighlighting
Returns whether highlighting is active.- Returns:
trueif highlighting is active
-
isLineWrapping
Returns whether line wrapping is active.- Returns:
trueif line wrapping is active
-
isReadOnly
- Specified by:
isReadOnlyin interfacecom.vaadin.v7.data.Property<String>- Overrides:
isReadOnlyin classcom.vaadin.ui.AbstractComponent- See Also:
-
isTabsVisible
Returns whether tabs are visible.- Returns:
trueif 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:
removeListenerin interfacecom.vaadin.v7.data.Property.ValueChangeNotifier- See Also:
-
removeValueChangeListener
- Specified by:
removeValueChangeListenerin interfacecom.vaadin.v7.data.Property.ValueChangeNotifier- See Also:
-
setCloseBrackets
Sets the auto close brackets feature enabled.- Parameters:
closeBrackets-trueto auto close brackets
-
setFontSize
Sets the editor font size.- Parameters:
fontSize- the editor font size
-
setHeight
- Specified by:
setHeightin interfacecom.vaadin.server.Sizeable- Overrides:
setHeightin classcom.vaadin.ui.AbstractComponent- See Also:
-
setHeight
- Specified by:
setHeightin interfacecom.vaadin.server.Sizeable- Overrides:
setHeightin classcom.vaadin.ui.AbstractComponent- See Also:
-
setHighlighting
Sets the language highlighting enabled.- Parameters:
highlighting-trueto highlight
-
setLanguage
Sets the editor language.- Parameters:
codeMirrorLanguage- the editor language
-
setLineWrapping
Sets line wrapping enabled.- Parameters:
lineWrapping-trueto wrap lines
-
setReadOnly
- Specified by:
setReadOnlyin interfacecom.vaadin.v7.data.Property<String>- Overrides:
setReadOnlyin classcom.vaadin.ui.AbstractComponent- See Also:
-
setTabsVisible
Sets tab characters visible.- Parameters:
tabsVisible-trueto show tab characters
-
setTheme
Sets the editor theme.- Parameters:
codeMirrorTheme- the editor theme
-
setValue
Sets the editor content value.- Specified by:
setValuein interfacecom.vaadin.v7.data.Property<String>- Parameters:
value- the content value
-
setWidth
- Specified by:
setWidthin interfacecom.vaadin.server.Sizeable- Overrides:
setWidthin classcom.vaadin.ui.AbstractComponent- See Also:
-
setWidth
- Specified by:
setWidthin interfacecom.vaadin.server.Sizeable- Overrides:
setWidthin classcom.vaadin.ui.AbstractComponent- See Also:
-
getState
- Overrides:
getStatein classcom.vaadin.ui.AbstractJavaScriptComponent- See Also:
-
addValueChangeListener(com.vaadin.v7.data.Property.ValueChangeListener)