You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/08/13 20:47:05 UTC

[3/9] git commit: Use DeprecationWarning with the Zone component's show and update parameters.

Use DeprecationWarning with the Zone component's show and update parameters.


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/2285c7ed
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/2285c7ed
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/2285c7ed

Branch: refs/heads/5.4-js-rewrite
Commit: 2285c7ed5d3c88b0220f0dfbc9de6a477ba9f885
Parents: d5d7503
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Mon Aug 13 10:51:39 2012 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Mon Aug 13 10:51:39 2012 -0700

----------------------------------------------------------------------
 .../tapestry5/ComponentParameterConstants.java     |    6 ++++-
 .../apache/tapestry5/corelib/components/Zone.java  |   17 +++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2285c7ed/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
index 4d1ea09..f7a14d4 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/ComponentParameterConstants.java
@@ -1,4 +1,4 @@
-// Copyright 2011 The Apache Software Foundation
+// Copyright 2011, 2012 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -93,6 +93,8 @@ public class ComponentParameterConstants
      * The default name of a JS function attached to Tapestry.ElementEffect object to use for the initial
      * visualization of a {@link org.apache.tapestry5.corelib.components.Zone}.
      * Defaults to "show"
+     *
+     * @deprecated Deprecated in 5.4 with no replacement.
      */
     public static final String ZONE_SHOW_METHOD = "tapestry.components.zone_show_method";
 
@@ -100,6 +102,8 @@ public class ComponentParameterConstants
      * The default name of a JS function attached to Tapestry.ElementEffect object to point out an
      * update on a {@link org.apache.tapestry5.corelib.components.Zone}.
      * Defaults to "highlight"
+     *
+     * @deprecated Deprecated in 5.4 with no replacement.
      */
     public static final String ZONE_UPDATE_METHOD = "tapestry.components.zone_update_method";
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2285c7ed/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java
index 8cc4fb3..d91ec01 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Zone.java
@@ -27,6 +27,7 @@ import org.apache.tapestry5.internal.services.RequestConstants;
 import org.apache.tapestry5.ioc.annotations.Inject;
 import org.apache.tapestry5.json.JSONObject;
 import org.apache.tapestry5.services.*;
+import org.apache.tapestry5.services.compatibility.DeprecationWarning;
 import org.apache.tapestry5.services.javascript.JavaScriptSupport;
 import org.slf4j.Logger;
 
@@ -153,11 +154,27 @@ public class Zone implements ClientBodyElement
     @Environmental(false)
     private FormSupport formSupport;
 
+    @Inject
+    private DeprecationWarning deprecationWarning;
+
     String defaultElementName()
     {
         return resources.getElementName("div");
     }
 
+    void setupRender()
+    {
+        if (show != null)
+        {
+            deprecationWarning.componentParameter(resources, "show", "This parameter is ignored and may be removed.");
+        }
+
+        if (update != null)
+        {
+            deprecationWarning.componentParameter(resources, "update", "This parameter is ignored and may be removed.");
+        }
+    }
+
     void beginRender(MarkupWriter writer)
     {
         clientId = resources.isBound("id") ? idParameter : javascriptSupport.allocateClientId(resources);