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: 74   Methods: 1
NCLOC: 34   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
Button.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.form;
 16   
 
 17   
 import org.apache.tapestry.IForm;
 18   
 import org.apache.tapestry.IMarkupWriter;
 19   
 import org.apache.tapestry.IRequestCycle;
 20   
 
 21   
 /**
 22   
  * Implements a component that manages an HTML &lt;input type=button&gt; form element. [ <a
 23   
  * href="../../../../../ComponentReference/Button.html">Component Reference </a>]
 24   
  * <p>
 25   
  * This component is useful for attaching JavaScript onclick event handlers.
 26   
  * 
 27   
  * @author Howard Lewis Ship
 28   
  * @author Paul Geerts
 29   
  * @author Malcolm Edgar
 30   
  */
 31   
 
 32   
 public abstract class Button extends AbstractFormComponent
 33   
 {
 34  0
     protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
 35   
     {
 36  0
         IForm form = getForm(cycle);
 37   
 
 38  0
         if (form.wasPrerendered(writer, this))
 39  0
             return;
 40   
 
 41  0
         boolean rewinding = form.isRewinding();
 42   
 
 43  0
         String name = form.getElementId(this);
 44   
 
 45  0
         if (rewinding)
 46   
         {
 47  0
             return;
 48   
         }
 49   
 
 50  0
         writer.beginEmpty("input");
 51  0
         writer.attribute("type", "button");
 52  0
         writer.attribute("name", name);
 53   
 
 54  0
         if (isDisabled())
 55   
         {
 56  0
             writer.attribute("disabled", "disabled");
 57   
         }
 58   
 
 59  0
         String label = getLabel();
 60   
 
 61  0
         if (label != null)
 62   
         {
 63  0
             writer.attribute("value", label);
 64   
         }
 65   
 
 66  0
         renderInformalParameters(writer, cycle);
 67   
 
 68  0
         writer.closeTag();
 69   
     }
 70   
 
 71   
     public abstract String getLabel();
 72   
 
 73   
     public abstract boolean isDisabled();
 74   
 }