Class HybrisUiVisualizer

java.lang.Object
org.zkoss.zk.ui.impl.HybrisUiVisualizer
All Implemented Interfaces:
org.zkoss.zk.ui.sys.Visualizer

public class HybrisUiVisualizer extends 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

    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(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, String attr, Object[] values)
    Smart updates a component's attribute with an array of values.
    void
    addSmartUpdate(org.zkoss.zk.ui.Component comp, String attr, String value)
    Smart updates a component's attribute.
    void
    addSmartUpdate(org.zkoss.zk.ui.Component comp, String attr, org.zkoss.zk.ui.util.DeferredValue value)
    Smart updates an attribute of a component with a deferred value.
    final boolean
     
    void
    addUuidChanged(org.zkoss.zk.ui.Component comp, boolean addOnlyMoved)
    Called before changing the component's UUID.
    void
     
    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
    Returns the reason to aborting, or null if no aborting at all.
    final org.zkoss.zk.ui.Execution
     
    org.zkoss.zk.ui.Component
    Returns the owner component for this execution, or null if this execution is not owned by any component.
    Returns a list of AuResponse according to what components are invalidated and attached.
    boolean
    Returns whether it is aborting.
    final boolean
     
    boolean
    isInvalidated(org.zkoss.zk.ui.Component comp)
    Returns if this component needs to be redrawn.
    boolean
     
    void
    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 Details

    • 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 Details

    • 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(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.
    • addInvalidate

      public void addInvalidate(org.zkoss.zk.ui.Component comp)
      Adds an invalidated component. Once invalidated, all invocations to addSmartUpdate(org.zkoss.zk.ui.Component, java.lang.String, java.lang.String) are ignored in this execution.
    • addSmartUpdate

      public void addSmartUpdate(org.zkoss.zk.ui.Component comp, String attr, 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, 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, String attr, 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
    • addUuidChanged

      public void addUuidChanged(org.zkoss.zk.ui.Component comp, boolean addOnlyMoved)
      Called before changing the component's UUID.
      Parameters:
      addOnlyMoved - if true, it is added only if it was moved before (see addMoved(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)).
    • addResponse

      public void addResponse(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 List getResponses() throws IOException
      Returns a list of AuResponse according to what components are invalidated and attached.
      Throws:
      IOException
    • pushOwner

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

      public void popOwner()
      Called after a component redraws itself if it ever calls pushOwner(org.zkoss.zk.ui.Component).
    • 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.

    • getAbortingReason

      public org.zkoss.zk.ui.sys.AbortingReason getAbortingReason()
      Returns the reason to aborting, or null if no aborting at all.
      See Also:
    • 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.