Class CmsCodeMirrorWidget
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
org.opencms.acacia.client.widgets.code.CmsCodeMirrorWidget
- All Implemented Interfaces:
com.google.gwt.event.dom.client.HasFocusHandlers,com.google.gwt.event.logical.shared.HasAttachHandlers,com.google.gwt.event.logical.shared.HasResizeHandlers,com.google.gwt.event.logical.shared.HasValueChangeHandlers<String>,com.google.gwt.event.shared.HasHandlers,com.google.gwt.user.client.EventListener,com.google.gwt.user.client.TakesValue<String>,com.google.gwt.user.client.ui.HasValue<String>,com.google.gwt.user.client.ui.HasVisibility,com.google.gwt.user.client.ui.HasWidgets,com.google.gwt.user.client.ui.HasWidgets.ForIsWidget,com.google.gwt.user.client.ui.IndexedPanel,com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget,com.google.gwt.user.client.ui.IsWidget,Iterable<com.google.gwt.user.client.ui.Widget>,I_CmsEditWidget
public class CmsCodeMirrorWidget
extends com.google.gwt.user.client.ui.ComplexPanel
implements I_CmsEditWidget, com.google.gwt.event.logical.shared.HasResizeHandlers
Client-side content editor widget for editing source code using the CodeMirror library.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabledNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidgetNested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel
com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget -
Field Summary
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.gwt.event.shared.HandlerRegistrationaddFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler handler) com.google.gwt.event.shared.HandlerRegistrationaddValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler<String> handler) voidRepresents a value change event.voidfireResizeeEvent(com.google.gwt.event.logical.shared.ResizeEvent event) Represents a resize event.protected voidfireValueChange(boolean force) Fires the value change event, if the value has changed.Gets the effective mode to use, which depends both on the selected mode and on whether the user has enabled syntax highlighting.protected StringReturns the previous value.getValue()booleanisActive()Returns if the widget is active.protected voidonAttach()voidThis method is called when a widget is attached to the browser's document.booleanowns(com.google.gwt.dom.client.Element element) Returns true if the element should be logically counted as part of the widget for the purpose of determining whether a mouse click is "outside".voidsetActive(boolean active) Sets the widget active/inactive.voidSets the name of input fields.protected voidsetPreviousValue(String previousValue) Sets the previous value.voidvoidMethods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, removeMethods inherited from class com.google.gwt.user.client.ui.Panel
add, add, adopt, clear, doAttachChildren, doDetachChildren, orphan, removeMethods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onBrowserEvent, onDetach, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEventsMethods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEventMethods inherited from interface org.opencms.acacia.client.widgets.I_CmsEditWidget
shouldSetDefaultWhenDisabledMethods inherited from interface com.google.gwt.user.client.ui.IsWidget
asWidgetMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CmsCodeMirrorWidget
Creates a new display widget.- Parameters:
config- the widget configuration string
-
-
Method Details
-
addFocusHandler
public com.google.gwt.event.shared.HandlerRegistration addFocusHandler(com.google.gwt.event.dom.client.FocusHandler handler) - Specified by:
addFocusHandlerin interfacecom.google.gwt.event.dom.client.HasFocusHandlers- See Also:
-
fireChangeEvent
Represents a value change event. -
getEffectiveMode
Gets the effective mode to use, which depends both on the selected mode and on whether the user has enabled syntax highlighting.- Returns:
- the effective mode
-
getValue
-
isActive
Description copied from interface:I_CmsEditWidgetReturns if the widget is active.- Specified by:
isActivein interfaceI_CmsEditWidget- Returns:
trueif the widget is active- See Also:
-
onAttachWidget
Description copied from interface:I_CmsEditWidgetThis method is called when a widget is attached to the browser's document.It needs to call the
Widget.onAttach()method.- Specified by:
onAttachWidgetin interfaceI_CmsEditWidget- See Also:
-
owns
Description copied from interface:I_CmsEditWidgetReturns true if the element should be logically counted as part of the widget for the purpose of determining whether a mouse click is "outside". For example, this is needed if the widget uses a popup.- Specified by:
ownsin interfaceI_CmsEditWidget- Parameters:
element- the element to check- Returns:
- true if the element counts as part of the widget
- See Also:
-
setActive
Description copied from interface:I_CmsEditWidgetSets the widget active/inactive.- Specified by:
setActivein interfaceI_CmsEditWidget- Parameters:
active-trueto activate the widget- See Also:
-
setName
Description copied from interface:I_CmsEditWidgetSets the name of input fields.- Specified by:
setNamein interfaceI_CmsEditWidget- Parameters:
name- of the input field- See Also:
-
setValue
-
setValue
- Specified by:
setValuein interfacecom.google.gwt.user.client.ui.HasValue<String>- Specified by:
setValuein interfaceI_CmsEditWidget- See Also:
-
fireValueChange
Fires the value change event, if the value has changed.- Parameters:
force-trueto force firing the event, not regarding an actually changed value
-
getPreviousValue
Returns the previous value.- Returns:
- the previous value
-
onAttach
- Overrides:
onAttachin classcom.google.gwt.user.client.ui.Widget- See Also:
-
setPreviousValue
Sets the previous value.- Parameters:
previousValue- the previous value to set
-