Class HybrisUiVisualizer
- All Implemented Interfaces:
org.zkoss.zk.ui.sys.Visualizer
-
Constructor Summary
ConstructorsConstructorDescriptionHybrisUiVisualizer(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 TypeMethodDescriptionvoidaddInvalidate(org.zkoss.zk.ui.Component comp) Adds an invalidated component.voidaddInvalidate(org.zkoss.zk.ui.Page page) Invalidates the whole page.voidaddMoved(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.voidaddResponse(String key, org.zkoss.zk.au.AuResponse response) Adds a response directly (which will be returned whengetResponses()is called).voidaddSmartUpdate(org.zkoss.zk.ui.Component comp, String attr, Object[] values) Smart updates a component's attribute with an array of values.voidaddSmartUpdate(org.zkoss.zk.ui.Component comp, String attr, String value) Smart updates a component's attribute.voidaddSmartUpdate(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 booleanaddToFirstAsyncUpdate(List responses) voidaddUuidChanged(org.zkoss.zk.ui.Component comp, boolean addOnlyMoved) Called before changing the component's UUID.voiddisable()booleandisableClientUpdate(org.zkoss.zk.ui.Component comp, boolean disable) Sets whether to disable the update of the client widget.org.zkoss.zk.ui.sys.AbortingReasonReturns the reason to aborting, or null if no aborting at all.final org.zkoss.zk.ui.Executionorg.zkoss.zk.ui.ComponentgetOwner()Returns the owner component for this execution, or null if this execution is not owned by any component.Returns a list ofAuResponseaccording to what components are invalidated and attached.booleanReturns whether it is aborting.final booleanbooleanisInvalidated(org.zkoss.zk.ui.Component comp) Returns if this component needs to be redrawn.booleanvoidpopOwner()Called after a component redraws itself if it ever callspushOwner(org.zkoss.zk.ui.Component).voidpushOwner(org.zkoss.zk.ui.Component comp) Called before a component redraws itself if the component might include another page.voidsetAbortingReason(org.zkoss.zk.ui.sys.AbortingReason reason) Sets the reason to abort the current execution.
-
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-updaterecovering- whether this execution is in recovering, i.e., caused byFailoverManager.recover(org.zkoss.zk.ui.Session, org.zkoss.zk.ui.Execution, org.zkoss.zk.ui.Desktop).
-
HybrisUiVisualizer
Creates the following execution.
-
-
Method Details
-
getExecution
public final org.zkoss.zk.ui.Execution getExecution()- Specified by:
getExecutionin interfaceorg.zkoss.zk.ui.sys.Visualizer
-
isEverAsyncUpdate
public final boolean isEverAsyncUpdate()- Specified by:
isEverAsyncUpdatein interfaceorg.zkoss.zk.ui.sys.Visualizer
-
addToFirstAsyncUpdate
- Specified by:
addToFirstAsyncUpdatein interfaceorg.zkoss.zk.ui.sys.Visualizer
-
isRecovering
public boolean isRecovering()- Specified by:
isRecoveringin interfaceorg.zkoss.zk.ui.sys.Visualizer
-
disable
public void disable()- Specified by:
disablein interfaceorg.zkoss.zk.ui.sys.Visualizer
-
isInvalidated
public boolean isInvalidated(org.zkoss.zk.ui.Component comp) Returns if this component needs to be redrawn.Note:
- It always returns true if the current execution is not an asynchroous update.
- 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 toaddSmartUpdate(org.zkoss.zk.ui.Component, java.lang.String, java.lang.String)are ignored in this execution. -
addSmartUpdate
Smart updates a component's attribute. Meaningful only ifaddInvalidate(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
Smart updates a component's attribute with an array of values. Meaningful only ifaddInvalidate(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 movedoldpg- the page before movednewpg- 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 (seeaddMoved(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Page, org.zkoss.zk.ui.Page)).
-
addResponse
Adds a response directly (which will be returned whengetResponses()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
Returns a list ofAuResponseaccording 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 callspushOwner(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 bypushOwner(org.zkoss.zk.ui.Component).- Specified by:
getOwnerin interfaceorg.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 onUiEngine.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 isUiEngine'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. -
isAborting
public boolean isAborting()Returns whether it is aborting.The execution is aborting if
getAbortingReason()returns not null and the returned reason'sAbortingReason.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.
-