Class AbstractStatefulActionRenderer<INPUT,​OUTPUT>

    • Constructor Detail

      • AbstractStatefulActionRenderer

        public AbstractStatefulActionRenderer()
    • Method Detail

      • getValue

        protected <V> V getValue​(ActionContext<INPUT> actionContext,
                                 java.lang.String key)
        Reads a value from parent's widget model.

        Method is resistant to situation when many instances of a particular action used in single parent widgets.

        Type Parameters:
        V - value type
        Parameters:
        actionContext - action context
        key - value key
        Returns:
        value found or null
      • setValue

        protected void setValue​(ActionContext<INPUT> actionContext,
                                java.lang.String key,
                                java.lang.Object value)
        Puts a value to parent's widget model.

        Method is resistant to situation when many instances of a particular action used in single parent widgets.

        Parameters:
        actionContext - action context
        key - value key
        value - value to be put
      • addStateSocketListener

        protected void addStateSocketListener​(Action parent,
                                              ActionContext<INPUT> context,
                                              java.lang.String listenerIdentity,
                                              java.lang.String socket,
                                              java.util.function.Supplier<org.zkoss.zk.ui.event.EventListener<SocketEvent>> listenerSupplier)
        Registers new socket listener on parent's widget, if it hasn't been done yet. Otherwise nothing happens. Messages received through provided socket will be processed and stored under specified key.
        Parameters:
        parent - action component
        context - action context
        listenerIdentity - unique identity of listener in scope of action
        socket - name of socket to attach to
        listenerSupplier - a method creating new instance of listener
        See Also:
        initializeStateSocketListener(Action, String, EventListener), createStateSocketListener(Action, ActionContext, String, Function)
      • createStateSocketListener

        protected org.zkoss.zk.ui.event.EventListener<SocketEvent> createStateSocketListener​(Action parent,
                                                                                             ActionContext<INPUT> context,
                                                                                             java.lang.String key,
                                                                                             java.util.function.Function valueSupplier)
        Creates new instance of socket listener.
        Parameters:
        parent - action component
        context - action context
        key - model key under which a processed input message will be kept
        valueSupplier - processing method
        Returns:
        new instance of socket listener