Coverage Report - org.apache.tapestry.contrib.ajax.AjaxStatus
 
Classes in this File Line Coverage Branch Coverage Complexity
AjaxStatus
0%
0/8
0%
0/2
1.5
 
 1  
 // Copyright 2007 The Apache Software Foundation
 2  
 //
 3  
 // Licensed under the Apache License, Version 2.0 (the "License");
 4  
 // you may not use this file except in compliance with the License.
 5  
 // You may obtain a copy of the License at
 6  
 //
 7  
 //     http://www.apache.org/licenses/LICENSE-2.0
 8  
 //
 9  
 // Unless required by applicable law or agreed to in writing, software
 10  
 // distributed under the License is distributed on an "AS IS" BASIS,
 11  
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
 // See the License for the specific language governing permissions and
 13  
 // limitations under the License.
 14  
 
 15  
 package org.apache.tapestry.contrib.ajax;
 16  
 
 17  
 import java.util.HashMap;
 18  
 import java.util.Map;
 19  
 import org.apache.tapestry.IMarkupWriter;
 20  
 import org.apache.tapestry.IRequestCycle;
 21  
 import org.apache.tapestry.IScript;
 22  
 import org.apache.tapestry.PageRenderSupport;
 23  
 import org.apache.tapestry.TapestryUtils;
 24  
 import org.apache.tapestry.components.Any;
 25  
 
 26  
 /**
 27  
  * @since 4.1.2
 28  
  */
 29  0
 public abstract class AjaxStatus extends Any
 30  
 {
 31  
     public abstract IScript getScript();
 32  
     
 33  
     protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
 34  
     {
 35  
         // render as if an Any component
 36  0
         super.renderComponent(writer, cycle);
 37  
         // then add the script
 38  0
         if(!cycle.isRewinding()) {
 39  0
             PageRenderSupport pageRenderSupport = TapestryUtils.getPageRenderSupport(cycle, this);
 40  0
             Map symbols = new HashMap();
 41  0
             symbols.put("id", getClientId());
 42  0
             getScript().execute(this, cycle, pageRenderSupport, symbols);
 43  
         }
 44  0
     }
 45  
 }