Coverage Report - org.apache.tapestry.wml.GoFormSupportImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
GoFormSupportImpl
0%
0/16
0%
0/2
1.333
 
 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
 26  
  * adjusts the output markup to conform to WML.
 27  
  * 
 28  
  * @author Howard M. Lewis Ship
 29  
  * @since 4.0
 30  
  */
 31  
 public class GoFormSupportImpl extends FormSupportImpl
 32  
 {
 33  
     public GoFormSupportImpl(IMarkupWriter writer, IRequestCycle cycle, IForm form)
 34  
     {
 35  0
         super(writer, cycle, form);
 36  0
     }
 37  
 
 38  
     protected void writeTag(IMarkupWriter writer, String method, String url)
 39  
     {
 40  0
         writer.begin("go");
 41  0
         writer.attribute("method", method);
 42  0
         writer.attribute("href", url);
 43  0
     }
 44  
 
 45  
     protected void writeHiddenFields()
 46  
     {
 47  
         // The super-implementation writes a <div> tag that's not
 48  
         // valid as WML.
 49  
         
 50  0
         writeHiddenFieldList(getHiddenFieldWriter());
 51  0
     }
 52  
     
 53  
     protected void writeHiddenField(IMarkupWriter writer, String name,
 54  
             String id, String value)
 55  
     {
 56  0
         writer.beginEmpty("postfield");
 57  0
         writer.attribute("name", name);
 58  
 
 59  0
         if (HiveMind.isNonBlank(id)) writer.attribute("id", id);
 60  
 
 61  0
         writer.attribute("value", value);
 62  0
         writer.println();
 63  0
     }
 64  
 
 65  
     public void addEventHandler(FormEventType type, String functionName)
 66  
     {
 67  0
         throw new UnsupportedOperationException("addEventHandler() not supported for WML Go component.");
 68  
     }
 69  
 
 70  
     protected void emitEventManagerInitialization()
 71  
     {
 72  0
     }
 73  
 }