Class AbstractTextBasedEditorRenderer<T>

    • Field Detail

      • SETTING_INPUT_INSTANT

        public static final java.lang.String SETTING_INPUT_INSTANT
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractTextBasedEditorRenderer

        public AbstractTextBasedEditorRenderer()
    • Method Detail

      • onChangingEvent

        protected void onChangingEvent​(EditorListener<T> listener,
                                       org.zkoss.zul.impl.InputElement editorView,
                                       org.zkoss.zk.ui.event.InputEvent event)
        Method called when something changed in the editor, for example every 1 sec while typing something
        Parameters:
        editorView - the Editor
        event -
      • onChangeEvent

        protected void onChangeEvent​(EditorListener<T> listener,
                                     org.zkoss.zul.impl.InputElement editorView)
        Method called when the editor value is changed and the editor is not focused anymore.
        Parameters:
        listener -
        editorView - the Editor
      • onOkEvent

        protected void onOkEvent​(EditorListener<T> listener,
                                 org.zkoss.zul.impl.InputElement editorView)
        Method called when the editor value is set
        Parameters:
        listener -
        editorView - the Editor
      • onCancelEvent

        protected void onCancelEvent​(EditorListener<T> listener,
                                     org.zkoss.zul.impl.InputElement editorView,
                                     T initialValue)
        Method called when the user cancelled his input.
        Parameters:
        listener -
        editorView - the Editor
      • onFocusEvent

        protected void onFocusEvent​(org.zkoss.zul.impl.InputElement editorView,
                                    java.lang.String initialEditText)
        Method called when the user focuses the Editor.
        Parameters:
        editorView - the Editor
        initialEditText -
      • handleChangeEvent

        protected void handleChangeEvent​(EditorListener<T> listener,
                                         org.zkoss.zul.impl.InputElement editorView)
      • handleChangeEvent

        protected void handleChangeEvent​(EditorListener<T> listener,
                                         T value)
      • handleChangingEvent

        protected void handleChangingEvent​(EditorListener<T> listener,
                                           org.zkoss.zul.impl.InputElement editorView,
                                           java.lang.String stringValue)
      • clearInvalidInputAndNotify

        protected void clearInvalidInputAndNotify​(EditorListener<T> listener,
                                                  org.zkoss.zul.impl.InputElement editorView)
      • hasInvalidInput

        protected boolean hasInvalidInput​(org.zkoss.zul.impl.InputElement editorView)
      • handleReadOnly

        protected void handleReadOnly​(EditorContext<T> context,
                                      org.zkoss.zul.impl.InputElement editorView)
        Utility method that assures proper handling of readonly/disabled attributes across different browsers.
        Parameters:
        context - editor context
        editorView - the view of the editor
      • setRawValue

        protected abstract void setRawValue​(org.zkoss.zul.impl.InputElement editorView,
                                            T rawValue)
        Sets the value to the given editor component.
        Parameters:
        editorView - the underlying editor component
        rawValue - the value
      • getRawValue

        protected abstract T getRawValue​(org.zkoss.zul.impl.InputElement editorView)
        Extracts value of the given editor component.
        Parameters:
        editorView - the underlying editor component
        Returns:
        the value
      • coerceFromString

        protected abstract T coerceFromString​(org.zkoss.zul.impl.InputElement editorView,
                                              java.lang.String text)
        Converts string value to a real value.
        Parameters:
        editorView - the underlying editor component
        text - the string vale
        Returns:
        the value
      • isPrimitive

        public boolean isPrimitive()
        Returns:
        true if editor has been created for primitive type like int/boolean/decimal/byte/short/long/char. Otherwise it returns false.