Class HybrisUiVisualizer

  • All Implemented Interfaces:
    org.zkoss.zk.ui.sys.Visualizer

    public class HybrisUiVisualizer
    extends java.lang.Object
    implements org.zkoss.zk.ui.sys.Visualizer
    • Constructor Summary

      Constructors 
      Constructor Description
      HybrisUiVisualizer​(org.zkoss.zk.ui.Execution exec, boolean asyncUpdate, boolean recovering)
      Creates a root execution (without parent).
      HybrisUiVisualizer​(HybrisUiVisualizer parent, org.zkoss.zk.ui.Execution exec)
      Creates the following execution.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addInvalidate​(org.zkoss.zk.ui.Component comp)
      Adds an invalidated component.
      void addInvalidate​(org.zkoss.zk.ui.Page page)
      Invalidates the whole page.
      void addMoved​(org.zkoss.zk.ui.Component comp, org.zkoss.zk.ui.Component oldparent, org.zkoss.zk.ui.Page oldpg, org.zkoss.zk.ui.Page newpg)
      Called to update (redraw) a component, when a component is moved.
      void addResponse​(java.lang.String key, org.zkoss.zk.au.AuResponse response)
      Adds a response directly (which will be returned when getResponses() is called).
      void addSmartUpdate​(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.Object[] values)
      Smart updates a component's attribute with an array of values.
      void addSmartUpdate​(org.zkoss.zk.ui.Component comp, java.lang.String attr, java.lang.String value)
      Smart updates a component's attribute.
      void addSmartUpdate​(org.zkoss.zk.ui.Component comp, java.lang.String attr, org.zkoss.zk.ui.util.DeferredValue value)
      Smart updates an attribute of a component with a deferred value.
      boolean addToFirstAsyncUpdate​(java.util.List responses)  
      void addUuidChanged​(org.zkoss.zk.ui.Component comp, boolean addOnlyMoved)
      Called before changing the component's UUID.
      void disable()  
      boolean disableClientUpdate​(org.zkoss.zk.ui.Component comp, boolean disable)
      Sets whether to disable the update of the client widget.
      org.zkoss.zk.ui.sys.AbortingReason getAbortingReason()
      Returns the reason to aborting, or null if no aborting at all.
      org.zkoss.zk.ui.Execution getExecution()  
      org.zkoss.zk.ui.Component getOwner()
      Returns the owner component for this execution, or null if this execution is not owned by any component.
      java.util.List getResponses()
      Returns a list of AuResponse according to what components are invalidated and attached.
      boolean isAborting()
      Returns whether it is aborting.
      boolean isEverAsyncUpdate()  
      boolean isInvalidated​(org.zkoss.zk.ui.Component comp)
      Returns if this component needs to be redrawn.
      boolean isRecovering()  
      void popOwner()
      Called after a component redraws itself if it ever calls pushOwner(org.zkoss.zk.ui.Component).
      void pushOwner​(org.zkoss.zk.ui.Component comp)
      Called before a component redraws itself if the component might include another page.
      void setAbortingReason​(org.zkoss.zk.ui.sys.AbortingReason reason)
      Sets the reason to abort the current execution.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HybrisUiVisualizer

        public HybrisUiVisualizer​(org.zkoss.zk.ui.Execution exec,
                                  boolean asyncUpdate,
                                  boolean recovering)
        Creates a root execution (without parent). In other words, it must be the first execution in the current request.
        Parameters:
        asyncUpdate - whether this execution is for async-update
        recovering - whether this execution is in recovering, i.e., caused by FailoverManager.recover(org.zkoss.zk.ui.Session, org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Desktop).
      • HybrisUiVisualizer

        public HybrisUiVisualizer​(HybrisUiVisualizer parent,
                                  org.zkoss.zk.ui.Execution exec)
        Creates the following execution.
    • Method Detail

      • getExecution

        public final org.zkoss.zk.ui.Execution getExecution()
        Specified by:
        getExecution in interface org.zkoss.zk.ui.sys.Visualizer
      • isEverAsyncUpdate

        public final boolean isEverAsyncUpdate()
        Specified by:
        isEverAsyncUpdate in interface org.zkoss.zk.ui.sys.Visualizer
      • addToFirstAsyncUpdate

        public final boolean addToFirstAsyncUpdate​(java.util.List responses)
        Specified by:
        addToFirstAsyncUpdate in interface org.zkoss.zk.ui.sys.Visualizer
      • isRecovering

        public boolean isRecovering()
        Specified by:
        isRecovering in interface org.zkoss.zk.ui.sys.Visualizer
      • disable

        public void disable()
        Specified by:
        disable in interface org.zkoss.zk.ui.sys.Visualizer
      • isInvalidated

        public boolean isInvalidated​(org.zkoss.zk.ui.Component comp)
        Returns if this component needs to be redrawn.

        Note:

        1. It always returns true if the current execution is not an asynchroous update.
        2. If its parent is invalidated, this component will be redrawn too, but this method returns false since addInvalidate(Component) was not called against this component.
        Since:
        3.0.5
      • addInvalidate

        public void addInvalidate​(org.zkoss.zk.ui.Page page)
        Invalidates the whole page.
      • addSmartUpdate

        public void addSmartUpdate​(org.zkoss.zk.ui.Component comp,
                                   java.lang.String attr,
                                   java.lang.String value)
        Smart updates a component's attribute. Meaningful only if addInvalidate(Component) is not called in this execution
      • addSmartUpdate

        public void addSmartUpdate​(org.zkoss.zk.ui.Component comp,
                                   java.lang.String attr,
                                   org.zkoss.zk.ui.util.DeferredValue value)
        Smart updates an attribute of a component with a deferred value. A deferred value is used to encapsulate a value that shall be retrieved only in the rendering phase.
        Since:
        3.0.1
      • addSmartUpdate

        public void addSmartUpdate​(org.zkoss.zk.ui.Component comp,
                                   java.lang.String attr,
                                   java.lang.Object[] values)
        Smart updates a component's attribute with an array of values. Meaningful only if addInvalidate(Component) is not called in this execution
        Since:
        3.0.5
      • disableClientUpdate

        public boolean disableClientUpdate​(org.zkoss.zk.ui.Component comp,
                                           boolean disable)
        Sets whether to disable the update of the client widget. By default, if a component is attached to a page, modications that change the visual representation will be sent to the client to ensure the consistency.
        Returns:
        whether it has been disabled before this invocation, i.e., the previous disable status
        Since:
        3.6.2
      • addMoved

        public void addMoved​(org.zkoss.zk.ui.Component comp,
                             org.zkoss.zk.ui.Component oldparent,
                             org.zkoss.zk.ui.Page oldpg,
                             org.zkoss.zk.ui.Page newpg)
        Called to update (redraw) a component, when a component is moved. If a component's page or parent is changed, this method need to be called only once for the top one.
        Parameters:
        oldparent - the parent before moved
        oldpg - the page before moved
        newpg - the page after moved
      • addResponse

        public void addResponse​(java.lang.String key,
                                org.zkoss.zk.au.AuResponse response)
        Adds a response directly (which will be returned when getResponses() is called).

        If the response is component-dependent, AuResponse.getDepends() must return a component. And, if the component is removed, the response is removed, too.

        Parameters:
        key - could be anything. The second invocation of this method in the same execution with the same key will override the previous one.
      • getResponses

        public java.util.List getResponses()
                                    throws java.io.IOException
        Returns a list of AuResponse according to what components are invalidated and attached.
        Throws:
        java.io.IOException
      • pushOwner

        public void pushOwner​(org.zkoss.zk.ui.Component comp)
        Called before a component redraws itself if the component might include another page.
      • getOwner

        public org.zkoss.zk.ui.Component getOwner()
        Returns the owner component for this execution, or null if this execution is not owned by any component. The owner is the top of the stack pushed by pushOwner(org.zkoss.zk.ui.Component).
        Specified by:
        getOwner in interface org.zkoss.zk.ui.sys.Visualizer
      • setAbortingReason

        public void setAbortingReason​(org.zkoss.zk.ui.sys.AbortingReason reason)
        Sets the reason to abort the current execution. if not null, it means the current execution is aborting and the specified argument is the reason to aborting. Its interpretation depends on UiEngine.

        Note: if setAbortingReason is ever set with non-null, you CANNOT set it back to null.

        The aborting flag means no more processing, i.e., dropping pending requests, events, and rendering.

        After call this method, you shall not keep processing the page because the rendering is dropped and the client is out-of-sync with the server.

        This method doesn't really abort pending events and requests. It just set a flag, getAbortingReason(), and it is UiEngine's job to detect this flag and handling it properly.

      • isAborting

        public boolean isAborting()
        Returns whether it is aborting.

        The execution is aborting if getAbortingReason() returns not null and the returned reason's AbortingReason.isAborting() is true.

        Note: Execution.isVoided() means the execution is voided and no output shall be generated. The request is taken charged by other servlet. On the other hand, isAborting() means the execution is aborting and the output shall still be generated (and sent). The request is still taken charged by this execution.