Clover coverage report - Code Coverage for tapestry release 3.1-alpha-1
Coverage timestamp: Mon Feb 21 2005 09:16:14 EST
file stats: LOC: 73   Methods: 1
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
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 <input type=button> form element.
 23   
  *
 24   
  *  [<a href="../../../../../ComponentReference/Button.html">Component Reference</a>]
 25   
  *  
 26   
  *  <p>This component is useful for attaching JavaScript onclick event handlers.
 27   
  *
 28   
  *  @author Howard Lewis Ship
 29   
  *  @author Paul Geerts
 30   
  *  @author Malcolm Edgar
 31   
  **/
 32   
 
 33   
 public abstract class Button extends AbstractFormComponent
 34   
 {
 35  0
     protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle)
 36   
     {
 37  0
         IForm form = getForm(cycle);
 38   
 
 39  0
         boolean rewinding = form.isRewinding();
 40   
 
 41  0
         String name = form.getElementId(this);
 42   
 
 43  0
         if (rewinding)
 44   
         {
 45  0
             return;
 46   
         }
 47   
 
 48  0
         writer.beginEmpty("input");
 49  0
         writer.attribute("type", "button");
 50  0
         writer.attribute("name", name);
 51   
 
 52  0
         if (isDisabled())
 53   
         {
 54  0
             writer.attribute("disabled", "disabled");
 55   
         }
 56   
 
 57  0
         String label = getLabel();
 58   
 
 59  0
         if (label != null)
 60   
         {
 61  0
             writer.attribute("value", label);
 62   
         }
 63   
 
 64  0
         renderInformalParameters(writer, cycle);
 65   
 
 66  0
         writer.closeTag();
 67   
     }
 68   
 
 69   
     public abstract String getLabel();
 70   
 
 71   
     public abstract boolean isDisabled();
 72   
 }
 73