Coverage Report - org.apache.myfaces.shared_impl.taglib.UIComponentTagBase
 
Classes in this File Line Coverage Branch Coverage Complexity
UIComponentTagBase
0%
0/56
0%
0/6
1.15
 
 1  
 /*
 2  
  *  Licensed to the Apache Software Foundation (ASF) under one
 3  
  *  or more contributor license agreements.  See the NOTICE file
 4  
  *  distributed with this work for additional information
 5  
  *  regarding copyright ownership.  The ASF licenses this file
 6  
  *  to you under the Apache License, Version 2.0 (the
 7  
  *  "License"); you may not use this file except in compliance
 8  
  *  with the License.  You may obtain a copy of the License at
 9  
  * 
 10  
  *  http://www.apache.org/licenses/LICENSE-2.0
 11  
  * 
 12  
  *  Unless required by applicable law or agreed to in writing,
 13  
  *  software distributed under the License is distributed on an
 14  
  *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 15  
  *  KIND, either express or implied.  See the License for the
 16  
  *  specific language governing permissions and limitations
 17  
  *  under the License.
 18  
  */
 19  
 package org.apache.myfaces.shared_impl.taglib;
 20  
 
 21  
 import org.apache.myfaces.shared_impl.renderkit.JSFAttr;
 22  
 
 23  
 import javax.faces.component.UIComponent;
 24  
 import javax.faces.webapp.UIComponentTag;
 25  
 
 26  
 /**
 27  
  * @author Manfred Geiler (latest modification by $Author: matzew $)
 28  
  * @version $Revision: 557350 $ $Date: 2007-07-18 13:19:50 -0500 (Wed, 18 Jul 2007) $
 29  
  *
 30  
  * @deprecated use {@link UIComponentELTagBase} instead
 31  
  */
 32  0
 public abstract class UIComponentTagBase
 33  
         extends UIComponentTag
 34  
 {
 35  
     //private static final Log log = LogFactory.getLog(UIComponentTagBase.class);
 36  
 
 37  
     //UIComponent attributes
 38  
     private String _forceId;
 39  0
     private String _forceIdIndex = "true";
 40  
     private String _javascriptLocation;
 41  
     private String _imageLocation;
 42  
     private String _styleLocation;
 43  
 
 44  
     //Special UIComponent attributes (ValueHolder, ConvertibleValueHolder)
 45  
     private String _value;
 46  
     private String _converter;
 47  
     //attributes id, rendered and binding are handled by UIComponentTag
 48  
 
 49  
     public void release() {
 50  0
         super.release();
 51  
 
 52  0
         _forceId=null;
 53  
         //see declaration of that property
 54  0
         _forceIdIndex = "true";
 55  
 
 56  0
         _value=null;
 57  0
         _converter=null;
 58  
         
 59  0
         _javascriptLocation = null;
 60  0
         _imageLocation = null;
 61  0
         _styleLocation = null;
 62  0
     }
 63  
 
 64  
     protected void setProperties(UIComponent component)
 65  
     {
 66  0
         super.setProperties(component);
 67  
 
 68  0
         setBooleanProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.FORCE_ID_ATTR, _forceId);
 69  0
         setBooleanProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.FORCE_ID_INDEX_ATTR, _forceIdIndex);
 70  0
         if (_javascriptLocation != null) setStringProperty(component, JSFAttr.JAVASCRIPT_LOCATION, _javascriptLocation);
 71  0
         if (_imageLocation != null) setStringProperty(component, org.apache.myfaces.shared_impl.renderkit.JSFAttr.IMAGE_LOCATION, _imageLocation);
 72  0
         if (_styleLocation != null) setStringProperty(component, JSFAttr.STYLE_LOCATION, _styleLocation);
 73  
 
 74  
         //rendererType already handled by UIComponentTag
 75  
 
 76  0
         setValueProperty(component, _value);
 77  0
         setConverterProperty(component, _converter);
 78  0
     }
 79  
 
 80  
     /**
 81  
      * Sets the forceId attribute of the tag.  NOTE: Not every tag that extends this class will
 82  
      * actually make use of this attribute.  Check the TLD to see which components actually
 83  
      * implement it.
 84  
      *
 85  
      * @param aForceId The value of the forceId attribute.
 86  
      */
 87  
     public void setForceId(String aForceId)
 88  
     {
 89  0
         _forceId = aForceId;
 90  0
     }
 91  
 
 92  
     /**
 93  
      * Sets the forceIdIndex attribute of the tag.  NOTE: Not every tag that extends this class will
 94  
      * actually make use of this attribute.  Check the TLD to see which components actually implement it.
 95  
      *
 96  
      * @param aForceIdIndex The value of the forceIdIndex attribute.
 97  
      */
 98  
     public void setForceIdIndex(String aForceIdIndex)
 99  
     {
 100  0
         _forceIdIndex = aForceIdIndex;
 101  0
     }
 102  
 
 103  
     public void setValue(String value)
 104  
     {
 105  0
         _value = value;
 106  0
     }
 107  
 
 108  
     public void setConverter(String converter)
 109  
     {
 110  0
         _converter = converter;
 111  0
     }
 112  
 
 113  
 
 114  
     /**
 115  
      * Sets the javascript location attribute of the tag.  NOTE: Not every tag that extends this class will
 116  
      * actually make use of this attribute.  Check the TLD to see which components actually implement it.
 117  
      *
 118  
      * @param aJavascriptLocation The alternate javascript location to use.
 119  
      */
 120  
     public void setJavascriptLocation(String aJavascriptLocation)
 121  
     {
 122  0
         _javascriptLocation = aJavascriptLocation;
 123  0
     }
 124  
 
 125  
     /**
 126  
      * Sets the image location attribute of the tag.  NOTE: Not every tag that extends this class will
 127  
      * actually make use of this attribute.  Check the TLD to see which components actually implement it.
 128  
      *
 129  
      * @param aImageLocation The alternate image location to use.
 130  
      */
 131  
     public void setImageLocation(String aImageLocation)
 132  
     {
 133  0
         _imageLocation = aImageLocation;
 134  0
     }
 135  
 
 136  
     /**
 137  
      * Sets the style location attribute of the tag.  NOTE: Not every tag that extends this class will
 138  
      * actually make use of this attribute.  Check the TLD to see which components actually implement it.
 139  
      *
 140  
      * @param aStyleLocation The alternate style location to use.
 141  
      */
 142  
     public void setStyleLocation(String aStyleLocation)
 143  
     {
 144  0
         _styleLocation = aStyleLocation;
 145  0
     }
 146  
 
 147  
     // sub class helpers
 148  
 
 149  
     protected void setIntegerProperty(UIComponent component, String propName, String value)
 150  
     {
 151  0
         UIComponentTagUtils.setIntegerProperty(getFacesContext(), component, propName, value);
 152  0
     }
 153  
 
 154  
     protected void setLongProperty(UIComponent component, String propName, String value)
 155  
     {
 156  0
         UIComponentTagUtils.setLongProperty(getFacesContext(), component, propName, value);
 157  0
     }
 158  
 
 159  
     protected void setStringProperty(UIComponent component, String propName, String value)
 160  
     {
 161  0
         UIComponentTagUtils.setStringProperty(getFacesContext(), component, propName, value);
 162  0
     }
 163  
 
 164  
     protected void setBooleanProperty(UIComponent component, String propName, String value)
 165  
     {
 166  0
         UIComponentTagUtils.setBooleanProperty(getFacesContext(), component, propName, value);
 167  0
     }
 168  
 
 169  
     private void setValueProperty(UIComponent component, String value)
 170  
     {
 171  0
         UIComponentTagUtils.setValueProperty(getFacesContext(), component, value);
 172  0
     }
 173  
 
 174  
     private void setConverterProperty(UIComponent component, String value)
 175  
     {
 176  0
         UIComponentTagUtils.setConverterProperty(getFacesContext(), component, value);
 177  0
     }
 178  
 
 179  
     protected void setValidatorProperty(UIComponent component, String value)
 180  
     {
 181  0
         UIComponentTagUtils.setValidatorProperty(getFacesContext(), component, value);
 182  0
     }
 183  
 
 184  
     protected void setActionProperty(UIComponent component, String action)
 185  
     {
 186  0
         UIComponentTagUtils.setActionProperty(getFacesContext(), component, action);
 187  0
     }
 188  
 
 189  
     protected void setActionListenerProperty(UIComponent component, String actionListener)
 190  
     {
 191  0
         UIComponentTagUtils.setActionListenerProperty(getFacesContext(), component, actionListener);
 192  0
     }
 193  
 
 194  
     protected void setValueChangedListenerProperty(UIComponent component, String valueChangedListener)
 195  
     {
 196  0
         UIComponentTagUtils.setValueChangedListenerProperty(getFacesContext(), component, valueChangedListener);
 197  0
     }
 198  
 
 199  
     protected void setValueBinding(UIComponent component,
 200  
                                    String propName,
 201  
                                    String value)
 202  
     {
 203  0
         UIComponentTagUtils.setValueBinding(getFacesContext(), component, propName, value);
 204  0
     }
 205  
 
 206  
 
 207  
 }
 208