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