Class DecoratedEditorRenderer

  • All Implemented Interfaces:
    CockpitEditorRenderer<java.lang.Object>, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware

    public class DecoratedEditorRenderer
    extends AbstractEditorRendererWrapper
    implements org.springframework.context.ApplicationContextAware
    The Editor that allows to wrap any already defined editor with some custom components or logic.
    • Field Detail

      • DECORATED_EDITORS_EDITOR_PATTERN

        protected static final java.util.regex.Pattern DECORATED_EDITORS_EDITOR_PATTERN
      • DECORATED_EDITORS_DECORATOR_PATTERN

        protected static final java.util.regex.Pattern DECORATED_EDITORS_DECORATOR_PATTERN
      • YE_EDITOR_CONTAINER

        protected static final java.lang.String YE_EDITOR_CONTAINER
        See Also:
        Constant Field Values
      • YE_EDITOR_DECORATOR

        protected static final java.lang.String YE_EDITOR_DECORATOR
        See Also:
        Constant Field Values
      • YE_EDITOR_EMBEDDED

        protected static final java.lang.String YE_EDITOR_EMBEDDED
        See Also:
        Constant Field Values
    • Constructor Detail

      • DecoratedEditorRenderer

        public DecoratedEditorRenderer()
    • Method Detail

      • render

        public void render​(org.zkoss.zk.ui.Component parent,
                           EditorContext<java.lang.Object> context,
                           EditorListener<java.lang.Object> listener)
        Description copied from interface: CockpitEditorRenderer
        Creates a new editor component and attaches it to the specified Component component.
        Specified by:
        render in interface CockpitEditorRenderer<java.lang.Object>
        Parameters:
        parent - parent component the editor should be attached to
        context - the context for the editor creation
        listener - the listener to notify the rest of the world about value changes and other events
      • renderEmbeddedEditors

        protected java.util.Map<java.lang.Integer,​org.zkoss.zk.ui.Component> renderEmbeddedEditors​(org.zkoss.zul.Vlayout container,
                                                                                                         java.util.List<java.lang.String> definitions,
                                                                                                         EditorContext<java.lang.Object> context,
                                                                                                         EditorListener<java.lang.Object> listener)
        Renders embedded editors found in the definitions list.
        Parameters:
        container -
        definitions - list of embedded editors and decorators definitions.
        context -
        listener -
        Returns:
        map of position in definitions list and rendered embedded editor, which is wrapped in temporary container.
      • renderDecorators

        protected java.util.Map<java.lang.Integer,​org.zkoss.zk.ui.Component> renderDecorators​(org.zkoss.zul.Vlayout container,
                                                                                                    java.util.List<java.lang.String> definitions,
                                                                                                    EditorContext<java.lang.Object> context,
                                                                                                    EditorListener<java.lang.Object> listener)
        Renders decorators found in the definitions list.
        Parameters:
        container -
        definitions - list of embedded editors and decorators definitions.
        context -
        listener -
        Returns:
        map of position in definitions list and rendered decorator editor which is wrapped in temporary container.
      • layoutComponentsInOrder

        protected void layoutComponentsInOrder​(org.zkoss.zul.Vlayout container,
                                               java.util.Map<java.lang.Integer,​org.zkoss.zk.ui.Component> positionToComponent,
                                               java.util.List<java.lang.String> definitions)
        Layouts editors and decorators in order from definitions list.
        Parameters:
        container - container on which components will be layout.
        positionToComponent - map of position definitions list and rendered components (embedded editors and decorators).
        definitions - list of embedded editors and decorators definitions.
      • renderDecorator

        protected void renderDecorator​(org.zkoss.zul.Vlayout parent,
                                       EditorContext<java.lang.Object> context,
                                       EditorListener<java.lang.Object> listener,
                                       java.lang.String decorator)
      • renderEmbeddedEditor

        protected void renderEmbeddedEditor​(org.zkoss.zul.Vlayout parent,
                                            EditorContext<java.lang.Object> context,
                                            EditorListener<java.lang.Object> listener,
                                            java.lang.String editor)
      • getApplicationContext

        protected org.springframework.context.ApplicationContext getApplicationContext()
      • setApplicationContext

        @Autowired
        public void setApplicationContext​(org.springframework.context.ApplicationContext context)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException