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 org.apache.myfaces.shared_orchestra.renderkit.html.HTML;
    22  import org.apache.myfaces.shared_orchestra.renderkit.JSFAttr;
    23
    24  import javax.faces.component.UIComponent;
    25
    26
    27  /**
    28   * Common base tag class for HtmlSelectOneMenu and HtmlSelectManyMenu 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 HtmlSelectMenuTagBase
    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 menu
    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 _tabindex;
    57
    58      // UIInput attributes
    59      // --> already implemented in HtmlInputTagBase
    60
    61      // UISelectMany attributes
    62      //selectedValues cannot be set here, is set in JSP-parsing
    63
    64      //HtmlSelectManyMenu Attributes
    65      private String _border;
    66
    67      // HTMLSelectManyAttributes attributes
    68      private String _disabledClass;
    69      private String _enabledClass;
    70
    71
    72      public void release() {
    73          super.release();
    74          _accesskey=null;
    75          _datafld=null;
    76          _datasrc=null;
    77          _dataformatas=null;
    78          _disabled=null;
    79          _name=null;
    80          _onblur=null;
    81          _onchange=null;
    82          _onfocus=null;
    83          _onselect=null;
    84          _tabindex=null;
    85          _border=null;
    86          _disabledClass=null;
    87          _enabledClass=null;
    88      }
    89
    90      protected void setProperties(UIComponent component)
    91      {
    92          super.setProperties(component);
    93
    94          setStringProperty(component, HTML.ACCESSKEY_ATTR, _accesskey);
    95          setStringProperty(component, HTML.DATAFLD_ATTR, _datafld);
    96          setStringProperty(component,HTML.DATASRC_ATTR, _datasrc);
    97          setStringProperty(component, HTML.DATAFORMATAS_ATTR, _dataformatas);
    98          setBooleanProperty(component, HTML.DISABLED_ATTR, _disabled);
    99          setStringProperty(component, HTML.NAME_ATTR, _name);
    100         setStringProperty(component, HTML.ONBLUR_ATTR, _onblur);
    101         setStringProperty(component, HTML.ONCHANGE_ATTR, _onchange);
    102         setStringProperty(component, HTML.ONFOCUS_ATTR, _onfocus);
    103         setStringProperty(component, HTML.ONSELECT_ATTR, _onselect);
    104         setStringProperty(component, HTML.TABINDEX_ATTR, _tabindex);
    105         setStringProperty(component, JSFAttr.DISABLED_CLASS_ATTR, _disabledClass);
    106         setStringProperty(component, JSFAttr.ENABLED_CLASS_ATTR, _enabledClass);
    107
    108         setIntegerProperty(component, HTML.BORDER_ATTR, _border);
    109    }
    110
    111     public void setAccesskey(String accesskey)
    112     {
    113         _accesskey = accesskey;
    114     }
    115     public void setBorder(String border)
    116     {
    117         _border = border;
    118     }
    119
    120     public void setDatafld(String datafld)
    121     {
    122         _datafld = datafld;
    123     }
    124
    125     public void setDatasrc(String datasrc)
    126     {
    127         _datasrc = datasrc;
    128     }
    129
    130     public void setDataformatas(String dataformatas)
    131     {
    132         _dataformatas = dataformatas;
    133     }
    134
    135     public void setDisabled(String disabled)
    136     {
    137         _disabled = disabled;
    138     }
    139
    140     public void setName(String name)
    141     {
    142         _name = name;
    143     }
    144
    145     public void setOnblur(String onblur)
    146     {
    147         _onblur = onblur;
    148     }
    149
    150     public void setOnchange(String onchange)
    151     {
    152         _onchange = onchange;
    153     }
    154
    155     public void setOnfocus(String onfocus)
    156     {
    157         _onfocus = onfocus;
    158     }
    159
    160     public void setOnselect(String onselect)
    161     {
    162         _onselect = onselect;
    163     }
    164
    165     public void setTabindex(String tabindex)
    166     {
    167         _tabindex = tabindex;
    168     }
    169
    170     public void setDisabledClass(String disabledClass)
    171     {
    172         _disabledClass = disabledClass;
    173     }
    174
    175     public void setEnabledClass(String enabledClass)
    176     {
    177         _enabledClass = enabledClass;
    178     }
    179 }