View Javadoc

    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_orchestra.taglib.html;
    20
    21  import javax.faces.component.UIComponent;
    22
    23  import org.apache.myfaces.shared_orchestra.renderkit.JSFAttr;
    24  import org.apache.myfaces.shared_orchestra.renderkit.html.HTML;
    25
    26
    27  /**
    28   * Common base tag class for HtmlSelectOneListbox and HtmlSelectManyListbox components.
    29   *
    30   * @author Manfred Geiler (latest modification by $Author: paulsp $)
    31   * @author Martin Marinschek
    32   * @version $Revision: 495108 $ $Date: 2007-01-10 23:15:27 -0500 (Wed, 10 Jan 2007) $
    33   */
    34  public abstract class HtmlSelectListboxTagBase
    35          extends org.apache.myfaces.shared_orchestra.taglib.html.HtmlInputTagBase
    36  {
    37      // UIComponent attributes --> already implemented in UIComponentTagBase
    38
    39      // user role attributes --> already implemented in UIComponentTagBase
    40
    41      // HTML universal attributes --> already implemented in HtmlComponentTagBase
    42
    43      // HTML event handler attributes --> already implemented in HtmlComponentTagBase
    44
    45      // HTML input attributes relevant for checkbox-input
    46      private String _accesskey;
    47      private String _datafld;
    48      private String _datasrc;
    49      private String _dataformatas;
    50      private String _disabled;
    51      private String _name;
    52      private String _onblur;
    53      private String _onchange;
    54      private String _onfocus;
    55      private String _onselect;
    56      private String _size;
    57      private String _tabindex;
    58
    59      // UIInput attributes
    60      // --> already implemented in HtmlInputTagBase
    61
    62      // UISelectMany attributes
    63      //selectedValues cannot be set here, is set in JSP-parsing
    64
    65      // HTMLSelectManyAttributes attributes
    66      private String _disabledClass;
    67      private String _enabledClass;
    68
    69      public void release() {
    70          super.release();
    71          _accesskey=null;
    72          _datafld=null;
    73          _datasrc=null;
    74          _dataformatas=null;
    75          _disabled=null;
    76          _name=null;
    77          _onblur=null;
    78          _onchange=null;
    79          _onfocus=null;
    80          _onselect=null;
    81          _size=null;
    82          _tabindex=null;
    83          _disabledClass = null;
    84          _enabledClass = null;
    85      }
    86
    87      protected void setProperties(UIComponent component)
    88      {
    89          super.setProperties(component);
    90
    91          setStringProperty(component, HTML.ACCESSKEY_ATTR, _accesskey);
    92          setStringProperty(component, HTML.DATAFLD_ATTR, _datafld);
    93          setStringProperty(component, HTML.DATASRC_ATTR, _datasrc);
    94          setStringProperty(component, HTML.DATAFORMATAS_ATTR, _dataformatas);
    95          setBooleanProperty(component, HTML.DISABLED_ATTR, _disabled);
    96          setStringProperty(component, HTML.NAME_ATTR, _name);
    97          setStringProperty(component, HTML.ONBLUR_ATTR, _onblur);
    98          setStringProperty(component, HTML.ONCHANGE_ATTR, _onchange);
    99          setStringProperty(component, HTML.ONFOCUS_ATTR, _onfocus);
    100         setStringProperty(component, HTML.ONSELECT_ATTR, _onselect);
    101         setIntegerProperty(component, HTML.SIZE_ATTR, _size);
    102         setStringProperty(component, HTML.TABINDEX_ATTR, _tabindex);
    103
    104         setStringProperty(component, JSFAttr.DISABLED_CLASS_ATTR, _disabledClass);
    105         setStringProperty(component, JSFAttr.ENABLED_CLASS_ATTR, _enabledClass);
    106    }
    107
    108     public void setAccesskey(String accesskey)
    109     {
    110         _accesskey = accesskey;
    111     }
    112
    113     public void setDatafld(String datafld)
    114     {
    115         _datafld = datafld;
    116     }
    117
    118     public void setDatasrc(String datasrc)
    119     {
    120         _datasrc = datasrc;
    121     }
    122
    123     public void setDataformatas(String dataformatas)
    124     {
    125         _dataformatas = dataformatas;
    126     }
    127
    128     public void setDisabled(String disabled)
    129     {
    130         _disabled = disabled;
    131     }
    132
    133     public void setName(String name)
    134     {
    135         _name = name;
    136     }
    137
    138     public void setOnblur(String onblur)
    139     {
    140         _onblur = onblur;
    141     }
    142
    143     public void setOnchange(String onchange)
    144     {
    145         _onchange = onchange;
    146     }
    147
    148     public void setOnfocus(String onfocus)
    149     {
    150         _onfocus = onfocus;
    151     }
    152
    153     public void setOnselect(String onselect)
    154     {
    155         _onselect = onselect;
    156     }
    157
    158     public void setSize(String size)
    159     {
    160         _size = size;
    161     }
    162
    163     public void setTabindex(String tabindex)
    164     {
    165         _tabindex = tabindex;
    166     }
    167
    168     public void setDisabledClass(String disabledClass)
    169     {
    170         _disabledClass = disabledClass;
    171     }
    172
    173     public void setEnabledClass(String enabledClass)
    174     {
    175         _enabledClass = enabledClass;
    176     }
    177 }