Clover coverage report - Code Coverage for tapestry release 4.0-alpha-3
Coverage timestamp: Mon May 16 2005 09:05:49 EDT
file stats: LOC: 62   Methods: 4
NCLOC: 33   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
GoFormSupportImpl.java 50% 81.8% 75% 76.5%
coverage coverage
 1   
 // Copyright 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.wml;
 16   
 
 17   
 import org.apache.hivemind.HiveMind;
 18   
 import org.apache.tapestry.IForm;
 19   
 import org.apache.tapestry.IMarkupWriter;
 20   
 import org.apache.tapestry.IRequestCycle;
 21   
 import org.apache.tapestry.form.FormEventType;
 22   
 import org.apache.tapestry.form.FormSupportImpl;
 23   
 
 24   
 /**
 25   
  * Subclass of {@link org.apache.tapestry.form.FormSupportImpl} that adjusts the output markup to
 26   
  * conform to WML.
 27   
  * 
 28   
  * @author Howard M. Lewis Ship
 29   
  * @since 4.0
 30   
  */
 31   
 public class GoFormSupportImpl extends FormSupportImpl
 32   
 {
 33  10
     public GoFormSupportImpl(IMarkupWriter writer, IRequestCycle cycle, IForm form)
 34   
     {
 35  10
         super(writer, cycle, form);
 36   
     }
 37   
 
 38  6
     protected void writeTag(IMarkupWriter writer, String method, String url)
 39   
     {
 40  6
         writer.begin("go");
 41  6
         writer.attribute("method", method);
 42  6
         writer.attribute("href", url);
 43   
     }
 44   
 
 45  30
     protected void writeHiddenField(IMarkupWriter writer, String name, String id, String value)
 46   
     {
 47  30
         writer.beginEmpty("postfield");
 48  30
         writer.attribute("name", name );
 49   
         
 50  30
         if (HiveMind.isNonBlank(id))
 51  0
             writer.attribute("id", id);
 52   
         
 53  30
         writer.attribute("value", value);
 54  30
         writer.println();
 55   
     }
 56   
     
 57  0
     public void addEventHandler(FormEventType type, String functionName)
 58   
     {
 59  0
         throw new UnsupportedOperationException(
 60   
                 "addEventHandler() not supported for WML Go component.");
 61   
     }
 62   
 }