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.JSFAttr;
    22  import org.apache.myfaces.shared_orchestra.renderkit.html.HTML;
    23
    24  import javax.faces.component.UIComponent;
    25
    26
    27  /**
    28   * @author Manfred Geiler (latest modification by $Author: grantsmith $)
    29   * @author Martin Marinschek
    30   * @version $Revision: 539533 $ $Date: 2007-05-18 12:47:08 -0500 (Fri, 18 May 2007) $
    31   */
    32  public abstract class HtmlCommandButtonTagBase
    33      extends HtmlComponentTagBase
    34  {
    35      //private static final Log log = LogFactory.getLog(HtmlCommandButtonTag.class);
    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 command-button
    46      private String _accesskey;
    47      private String _alt;
    48      private String _disabled;
    49      private String _onblur;
    50      private String _onchange;
    51      private String _onfocus;
    52      private String _onselect;
    53      private String _readonly;
    54      private String _tabindex;
    55      private String _type;
    56
    57      // UICommand attributes
    58      private String _action;
    59      private String _immediate;
    60      private String _actionListener;
    61
    62      // HtmlCommandButton attributes
    63      private String _image;
    64
    65      public void release() {
    66          super.release();
    67          _accesskey=null;
    68          _alt=null;
    69          _disabled=null;
    70          _onblur=null;
    71          _onchange=null;
    72          _onfocus=null;
    73          _onselect=null;
    74          _readonly=null;
    75          _tabindex=null;
    76          _type=null;
    77          _action=null;
    78          _immediate=null;
    79          _actionListener=null;
    80          _image=null;
    81      }
    82
    83      protected void setProperties(UIComponent component)
    84      {
    85          super.setProperties(component);
    86
    87          setStringProperty(component, HTML.ACCESSKEY_ATTR, _accesskey);
    88          setStringProperty(component, HTML.ALT_ATTR, _alt);
    89          setBooleanProperty(component, HTML.DISABLED_ATTR, _disabled);
    90          setStringProperty(component, HTML.ONBLUR_ATTR, _onblur);
    91          setStringProperty(component, HTML.ONCHANGE_ATTR, _onchange);
    92          setStringProperty(component, HTML.ONFOCUS_ATTR, _onfocus);
    93          setStringProperty(component, HTML.ONSELECT_ATTR, _onselect);
    94          setBooleanProperty(component, HTML.READONLY_ATTR, _readonly);
    95          setStringProperty(component, HTML.TABINDEX_ATTR, _tabindex);
    96          setStringProperty(component, HTML.TYPE_ATTR, _type);
    97          setActionProperty(component, _action);
    98          setActionListenerProperty(component, _actionListener);
    99          setBooleanProperty(component, JSFAttr.IMMEDIATE_ATTR, _immediate);
    100         setStringProperty(component, JSFAttr.IMAGE_ATTR, _image);
    101    }
    102
    103     public void setAccesskey(String accesskey)
    104     {
    105         _accesskey = accesskey;
    106     }
    107
    108     public void setAlt(String alt)
    109     {
    110         _alt = alt;
    111     }
    112
    113     public void setDisabled(String disabled)
    114     {
    115         _disabled = disabled;
    116     }
    117
    118     public void setOnblur(String onblur)
    119     {
    120         _onblur = onblur;
    121     }
    122
    123     public void setOnchange(String onchange)
    124     {
    125         _onchange = onchange;
    126     }
    127
    128     public void setOnfocus(String onfocus)
    129     {
    130         _onfocus = onfocus;
    131     }
    132
    133     public void setOnselect(String onselect)
    134     {
    135         _onselect = onselect;
    136     }
    137
    138     public void setReadonly(String readonly)
    139     {
    140         _readonly = readonly;
    141     }
    142
    143     public void setTabindex(String tabindex)
    144     {
    145         _tabindex = tabindex;
    146     }
    147
    148     public void setType(String type)
    149     {
    150         _type = type;
    151     }
    152
    153     public void setAction(String action)
    154     {
    155         _action = action;
    156     }
    157
    158     public void setImmediate(String immediate)
    159     {
    160         _immediate = immediate;
    161     }
    162
    163     public void setImage(String image)
    164     {
    165         _image = image;
    166     }
    167
    168     public void setActionListener(String actionListener)
    169     {
    170         _actionListener = actionListener;
    171     }
    172 }