Clover coverage report - Code Coverage for tapestry-contrib release 4.0-beta-10
Coverage timestamp: Sat Oct 8 2005 19:13:41 EDT
file stats: LOC: 73   Methods: 2
NCLOC: 41   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
XTile.java 0% 0% 0% 0%
coverage
 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.ILink;
 25    import org.apache.tapestry.services.LinkFactory;
 26    import org.apache.tapestry.services.ServiceConstants;
 27   
 28    /**
 29    * @author mindbridge
 30    * @author Paul Green
 31    * @since 4.0
 32    */
 33    public abstract class XTile extends BaseComponent implements IXTile
 34    {
 35    public abstract LinkFactory getLinkFactory();
 36   
 37    public abstract IActionListener getListener();
 38    public abstract String getSendName();
 39    public abstract String getReceiveName();
 40    public abstract String getErrorName();
 41    public abstract boolean getDisableCaching();
 42   
 43  0 public void trigger(IRequestCycle cycle) {
 44  0 IActionListener listener = getListener();
 45   
 46  0 if (listener == null)
 47  0 throw Tapestry.createRequiredParameterException(this, "listener");
 48   
 49  0 listener.actionTriggered(this, cycle);
 50    }
 51   
 52  0 public Map getScriptSymbols()
 53    {
 54  0 Map ret = new HashMap();
 55  0 ret.put("sendFunctionName", getSendName());
 56  0 ret.put("receiveFunctionName", getReceiveName());
 57  0 ret.put("errorFunctionName", getErrorName());
 58  0 ret.put("disableCaching", getDisableCaching() ? "true" : null);
 59   
 60  0 Map parameters = new HashMap();
 61  0 parameters.put(ServiceConstants.SERVICE, XTileService.SERVICE_NAME);
 62  0 parameters.put(ServiceConstants.PAGE, getPage().getPageName());
 63  0 parameters.put(ServiceConstants.COMPONENT, getIdPath());
 64   
 65  0 ILink link = getLinkFactory().constructLink(getPage().getRequestCycle(),
 66    false, parameters, false);
 67   
 68  0 ret.put("url", link.getURL());
 69   
 70  0 return ret;
 71    }
 72   
 73    }