Skip to content

Commit

Permalink
Move org.zkoss.zk.ui.util.DeferredValue to org.zkoss.zk.au
Browse files Browse the repository at this point in the history
Reason: it is not for application and it is for AU only.

git-svn-id: https://svn.potix.com/svn/zk1/branches/6.0@19123 dd50bd9b-9913-0410-b9ba-e07a3075be86
  • Loading branch information
tomyeh committed Feb 9, 2012
1 parent fdff154 commit 949f567
Show file tree
Hide file tree
Showing 18 changed files with 51 additions and 28 deletions.
1 change: 0 additions & 1 deletion zk/src/org/zkoss/zk/au/AuResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

import org.zkoss.zk.ui.Component;
import org.zkoss.zk.ui.Page;
import org.zkoss.zk.ui.util.DeferredValue;

/**
* A response sent from the server to the client via
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@
it will be useful, but WITHOUT ANY WARRANTY.
}}IS_RIGHT
*/
package org.zkoss.zk.ui.util;
package org.zkoss.zk.au;

/**
* Used with {@link org.zkoss.zk.ui.AbstractComponent#smartUpdate}
* to represent a value that shall be evaluated only in the rendering phase
* to represent the value of a smart update
* that shall be evaluated only in the rendering phase
* (rather than in the event processing phase).
*
* @author tomyeh
* @since 3.0.1
* @since 6.0.0
* @see UpdatePriority
*/
public interface DeferredValue {
/** Returns the value.
* It is called to retrieve the real value
* by the ZK engine in the rendering phase.
* @since 5.0.0 (return type becomes Object)
*/
public Object getValue();
}
2 changes: 1 addition & 1 deletion zk/src/org/zkoss/zk/au/out/AuDownload.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.zkoss.zk.au.out;

import org.zkoss.zk.au.AuResponse;
import org.zkoss.zk.ui.util.DeferredValue;
import org.zkoss.zk.au.DeferredValue;

/**
* A response to ask the client to download the specified URI.
Expand Down
10 changes: 5 additions & 5 deletions zk/src/org/zkoss/zk/au/out/AuInvoke.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public AuInvoke(Component comp, String function) {
* It cannot be null.
* @param function the function name
* @param arg the additional argument. It could be null, String, Date,
* {@link org.zkoss.zk.ui.util.DeferredValue},
* {@link org.zkoss.zk.au.DeferredValue},
* and any kind of objects that
* the client accepts (marshaled by JSON).
* @since 5.0.0
Expand Down Expand Up @@ -120,7 +120,7 @@ public AuInvoke(Component comp, String function, double arg) {
* It cannot be null.
* @param function the function name
* @param arg1 the additional argument. It could be null, String, Date,
* {@link org.zkoss.zk.ui.util.DeferredValue},
* {@link org.zkoss.zk.au.DeferredValue},
* and any kind of objects that
* the client accepts (marshaled by JSON).
* @param arg2 the 2nd additional argument.
Expand All @@ -137,7 +137,7 @@ public AuInvoke(Component comp, String function, Object arg1, Object arg2) {
* It cannot be null.
* @param function the function name
* @param arg1 the additional argument. It could be null, String, Date,
* {@link org.zkoss.zk.ui.util.DeferredValue},
* {@link org.zkoss.zk.au.DeferredValue},
* and any kind of objects that
* the client accepts (marshaled by JSON).
* @param arg2 the 2nd additional argument.
Expand All @@ -156,7 +156,7 @@ public AuInvoke(Component comp, String function, Object arg1, Object arg2,
* It cannot be null.
* @param function the function name
* @param args the additional arguments. It could be null, String, Date,
* {@link org.zkoss.zk.ui.util.DeferredValue}, {@link Component},
* {@link org.zkoss.zk.au.DeferredValue}, {@link Component},
* {@link org.zkoss.json.JavaScriptValue},
* and any kind of objects that
* the client accepts (notice that they are marshaled by JSON).
Expand Down Expand Up @@ -185,7 +185,7 @@ public AuInvoke(Component comp, String function, String... args) {
* the given arguments.
* @param function the function name
* @param args the additional arguments. It could be null, String, Date,
* {@link org.zkoss.zk.ui.util.DeferredValue}, {@link Component},
* {@link org.zkoss.zk.au.DeferredValue}, {@link Component},
* {@link org.zkoss.json.JavaScriptValue},
* and any kind of objects that
* the client accepts (notice that they are marshaled by JSON).
Expand Down
2 changes: 1 addition & 1 deletion zk/src/org/zkoss/zk/au/out/AuSetAttribute.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class AuSetAttribute extends AuResponse {
/** Construct an instance for miscellanous values, such as Boolean,
* Integer and so on.
* @param val the value. It could be null, String, Date,
* {@link org.zkoss.zk.ui.util.DeferredValue},
* {@link org.zkoss.zk.au.DeferredValue},
* and any kind of objects that
* the client accepts (marshaled by JSON).
Expand Down
6 changes: 3 additions & 3 deletions zk/src/org/zkoss/zk/ui/AbstractComponent.java
Original file line number Diff line number Diff line change
Expand Up @@ -1523,12 +1523,12 @@ protected void response(String key, AuResponse response) {
* to redraw.
*
* @param value the new value.
* If it is {@link org.zkoss.zk.ui.util.DeferredValue}, the value
* will be retrieved (by calling {@link org.zkoss.zk.ui.util.DeferredValue#getValue})
* If it is {@link org.zkoss.zk.au.DeferredValue}, the value
* will be retrieved (by calling {@link org.zkoss.zk.au.DeferredValue#getValue})
* in the rendering phase. It is useful if the value can not be determined now.
* <p>For some old application servers (example, Webshpere 5.1),
* {@link Execution#encodeURL} cannot be called in the event processing
* thread. So, the developers have to use {@link org.zkoss.zk.ui.util.DeferredValue}
* thread. So, the developers have to use {@link org.zkoss.zk.au.DeferredValue}
* or disable the use of the event processing thread
* (by use of <code>disable-event-thread</code> in zk.xml).
* <p>If you want to generate the JavaScript code directly (i.e.,
Expand Down
23 changes: 23 additions & 0 deletions zk/srcdpc/org/zkoss/zk/ui/util/DeferredValue.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* DeferredValue.java
Purpose:
Description:
History:
Mon Dec 17 14:22:06 2007, Created by tomyeh
Copyright (C) 2007 Potix Corporation. All Rights Reserved.
{{IS_RIGHT
This program is distributed under LGPL Version 2.1 in the hope that
it will be useful, but WITHOUT ANY WARRANTY.
}}IS_RIGHT
*/
package org.zkoss.zk.ui.util;

/**
* @deprecated As of release 6.0.0, replaced with {@link org.zkoss.zk.au.DeferredValue}.
*/
public interface DeferredValue extends org.zkoss.zk.au.DeferredValue {
}
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/A.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public String getZclass() {
return _zclass != null ? _zclass: "z-a";
}

private class EncodedHref implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedHref implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedHref();
}
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Audio.java
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public Media getMedia(String pathInfo) {
}
}

private class EncodedSrc implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedSrc implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedSrc();
}
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Button.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ protected boolean isChildable() {
return false;
}

private class EncodedHref implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedHref implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedHref();
}
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Filedownload.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import org.zkoss.zk.ui.Executions;
import org.zkoss.zk.ui.sys.WebAppCtrl;
import org.zkoss.zk.au.out.AuDownload;
import org.zkoss.zk.ui.util.DeferredValue;
import org.zkoss.zk.au.DeferredValue;

/**
* File download utilities.
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Flash.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ private String getMediaSrc() {
return Utils.getDynamicMediaURI(
this, _medver, _media.getName(), _media.getFormat());
}
private class EncodedSrc implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedSrc implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedSrc();
}
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Iframe.java
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public Media getMedia(String pathInfo) {
}
}

private class EncodedSrc implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedSrc implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedSrc();
}
Expand Down
4 changes: 2 additions & 2 deletions zul/src/org/zkoss/zul/Image.java
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,12 @@ public Media getMedia(String pathInfo) {
}
}

private class EncodedURL implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedURL implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedURL();
}
}
private class EncodedHoverURL implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedHoverURL implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedHoverURL();
}
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Menuitem.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
}

//Bug #2871082
private class EncodedHref implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedHref implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedHref();
}
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Script.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private String getEncodedSrcURL() {
final Desktop dt = getDesktop(); //it might not belong to any desktop
return dt != null ? dt.getExecution().encodeURL(_src): null;
}
private class EncodedSrcURL implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedSrcURL implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedSrcURL();
}
Expand Down
2 changes: 1 addition & 1 deletion zul/src/org/zkoss/zul/Style.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ private String getEncodedURL() {
return "";
}

private class EncodedURL implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedURL implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedURL();
}
Expand Down
4 changes: 2 additions & 2 deletions zul/src/org/zkoss/zul/impl/LabelImageElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,12 +287,12 @@ public Media getMedia(String pathInfo) {
return getImageContent();
}
}
private class EncodedImageURL implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedImageURL implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedImageURL();
}
}
private class EncodedHoverURL implements org.zkoss.zk.ui.util.DeferredValue {
private class EncodedHoverURL implements org.zkoss.zk.au.DeferredValue {
public Object getValue() {
return getEncodedHoverURL();
}
Expand Down

0 comments on commit 949f567

Please sign in to comment.