Class 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<java.lang.String>, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.TakesValue<java.lang.String>, com.google.gwt.user.client.ui.HasValue<java.lang.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, java.lang.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.DebugIdImplEnabled
      • Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets

        com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
      • Nested 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 
      Constructor Description
      CmsCodeMirrorWidget​(java.lang.String config)
      Creates a new display widget.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.gwt.event.shared.HandlerRegistration addFocusHandler​(com.google.gwt.event.dom.client.FocusHandler handler)  
      com.google.gwt.event.shared.HandlerRegistration addResizeHandler​(com.google.gwt.event.logical.shared.ResizeHandler handler)  
      com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler​(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)  
      void fireChangeEvent()
      Represents a value change event.
      void fireResizeeEvent​(com.google.gwt.event.logical.shared.ResizeEvent event)
      Represents a resize event.
      protected void fireValueChange​(boolean force)
      Fires the value change event, if the value has changed.
      java.lang.String getEffectiveMode()
      Gets the effective mode to use, which depends both on the selected mode and on whether the user has enabled syntax highlighting.
      protected java.lang.String getPreviousValue()
      Returns the previous value.
      java.lang.String getValue()  
      boolean isActive()
      Returns if the widget is active.
      protected void onAttach()  
      void onAttachWidget()
      This method is called when a widget is attached to the browser's document.
      boolean owns​(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".
      void setActive​(boolean active)
      Sets the widget active/inactive.
      void setName​(java.lang.String name)
      Sets the name of input fields.
      protected void setPreviousValue​(java.lang.String previousValue)
      Sets the previous value.
      void setValue​(java.lang.String value)  
      void setValue​(java.lang.String value, boolean fireEvents)  
      • Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel

        add, add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
      • Methods inherited from class com.google.gwt.user.client.ui.Panel

        add, add, adopt, clear, doAttachChildren, doDetachChildren, orphan, remove
      • Methods 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, unsinkEvents
      • Methods 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, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.google.gwt.event.shared.HasHandlers

        fireEvent
      • Methods inherited from interface com.google.gwt.user.client.ui.IsWidget

        asWidget
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • CmsCodeMirrorWidget

        public CmsCodeMirrorWidget​(java.lang.String config)
        Creates a new display widget.

        Parameters:
        config - the widget configuration string
    • Method Detail

      • addFocusHandler

        public com.google.gwt.event.shared.HandlerRegistration addFocusHandler​(com.google.gwt.event.dom.client.FocusHandler handler)
        Specified by:
        addFocusHandler in interface com.google.gwt.event.dom.client.HasFocusHandlers
        See Also:
        HasFocusHandlers.addFocusHandler(com.google.gwt.event.dom.client.FocusHandler)
      • addResizeHandler

        public com.google.gwt.event.shared.HandlerRegistration addResizeHandler​(com.google.gwt.event.logical.shared.ResizeHandler handler)
        Specified by:
        addResizeHandler in interface com.google.gwt.event.logical.shared.HasResizeHandlers
        See Also:
        HasResizeHandlers.addResizeHandler(com.google.gwt.event.logical.shared.ResizeHandler)
      • addValueChangeHandler

        public com.google.gwt.event.shared.HandlerRegistration addValueChangeHandler​(com.google.gwt.event.logical.shared.ValueChangeHandler<java.lang.String> handler)
        Specified by:
        addValueChangeHandler in interface com.google.gwt.event.logical.shared.HasValueChangeHandlers<java.lang.String>
        Specified by:
        addValueChangeHandler in interface I_CmsEditWidget
        See Also:
        HasValueChangeHandlers.addValueChangeHandler(com.google.gwt.event.logical.shared.ValueChangeHandler)
      • fireChangeEvent

        public void fireChangeEvent()
        Represents a value change event.

      • fireResizeeEvent

        public void fireResizeeEvent​(com.google.gwt.event.logical.shared.ResizeEvent event)
        Represents a resize event.

        Parameters:
        event - from text area panel
      • getEffectiveMode

        public java.lang.String 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

        public java.lang.String getValue()
        Specified by:
        getValue in interface com.google.gwt.user.client.ui.HasValue<java.lang.String>
        Specified by:
        getValue in interface com.google.gwt.user.client.TakesValue<java.lang.String>
        See Also:
        HasValue.getValue()
      • owns

        public boolean owns​(com.google.gwt.dom.client.Element element)
        Description copied from interface: I_CmsEditWidget
        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". For example, this is needed if the widget uses a popup.
        Specified by:
        owns in interface I_CmsEditWidget
        Parameters:
        element - the element to check
        Returns:
        true if the element counts as part of the widget
        See Also:
        I_CmsEditWidget.owns(com.google.gwt.dom.client.Element)
      • setValue

        public void setValue​(java.lang.String value)
        Specified by:
        setValue in interface com.google.gwt.user.client.ui.HasValue<java.lang.String>
        Specified by:
        setValue in interface com.google.gwt.user.client.TakesValue<java.lang.String>
        See Also:
        HasValue.setValue(java.lang.Object)
      • setValue

        public void setValue​(java.lang.String value,
                             boolean fireEvents)
        Specified by:
        setValue in interface com.google.gwt.user.client.ui.HasValue<java.lang.String>
        Specified by:
        setValue in interface I_CmsEditWidget
        See Also:
        HasValue.setValue(java.lang.Object, boolean)
      • fireValueChange

        protected void fireValueChange​(boolean force)
        Fires the value change event, if the value has changed.

        Parameters:
        force - true to force firing the event, not regarding an actually changed value
      • getPreviousValue

        protected java.lang.String getPreviousValue()
        Returns the previous value.

        Returns:
        the previous value
      • onAttach

        protected void onAttach()
        Overrides:
        onAttach in class com.google.gwt.user.client.ui.Widget
        See Also:
        FocusWidget.onAttach()
      • setPreviousValue

        protected void setPreviousValue​(java.lang.String previousValue)
        Sets the previous value.

        Parameters:
        previousValue - the previous value to set