Coverage Report - org.apache.tapestry.contrib.ajax.XTile
 
Classes in this File Line Coverage Branch Coverage Complexity
XTile
0% 
0% 
1.25
 
 1  
 // Copyright 2004, 2005 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  
 
 20  
 import org.apache.tapestry.BaseComponent;
 21  
 import org.apache.tapestry.IActionListener;
 22  
 import org.apache.tapestry.IRequestCycle;
 23  
 import org.apache.tapestry.Tapestry;
 24  
 import org.apache.tapestry.engine.IEngineService;
 25  
 import org.apache.tapestry.engine.ILink;
 26  
 
 27  
 /**
 28  
  * @author mindbridge
 29  
  * @author Paul Green
 30  
  * @since 4.0
 31  
  */
 32  0
 public abstract class XTile extends BaseComponent implements IXTile
 33  
 {
 34  
     public abstract IActionListener getListener();
 35  
 
 36  
     public abstract String getSendName();
 37  
 
 38  
     public abstract String getReceiveName();
 39  
 
 40  
     public abstract String getErrorName();
 41  
 
 42  
     public abstract boolean getDisableCaching();
 43  
 
 44  
     // Injected
 45  
 
 46  
     public abstract IEngineService getService();
 47  
 
 48  
     public void trigger(IRequestCycle cycle)
 49  
     {
 50  0
         IActionListener listener = getListener();
 51  
 
 52  0
         if (listener == null)
 53  0
             throw Tapestry.createRequiredParameterException(this, "listener");
 54  
 
 55  0
         listener.actionTriggered(this, cycle);
 56  0
     }
 57  
 
 58  
     public Map getScriptSymbols()
 59  
     {
 60  0
         ILink link = getService().getLink(false, this);
 61  
 
 62  0
         Map result = new HashMap();
 63  
 
 64  0
         result.put("sendFunctionName", getSendName());
 65  0
         result.put("receiveFunctionName", getReceiveName());
 66  0
         result.put("errorFunctionName", getErrorName());
 67  0
         result.put("disableCaching", getDisableCaching() ? "true" : null);
 68  0
         result.put("url", link.getURL());
 69  
 
 70  0
         return result;
 71  
     }
 72  
 
 73  
 }