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.taglib.UIComponentTagBase;
    23
    24  import javax.faces.component.UIComponent;
    25
    26  /**
    27   * @author Manfred Geiler (latest modification by $Author: grantsmith $)
    28   * @version $Revision: 472618 $ $Date: 2006-11-08 15:06:54 -0500 (Wed, 08 Nov 2006) $
    29   */
    30  public abstract class HtmlComponentTagBase
    31          extends UIComponentTagBase
    32  {
    33      //private static final Log log = LogFactory.getLog(HtmlComponentTag.class);
    34
    35      //HTML universal attributes
    36      private String _dir;
    37      private String _lang;
    38      private String _style;
    39      private String _styleClass;
    40      private String _title;
    41
    42      //HTML event handler attributes
    43      private String _onclick;
    44      private String _ondblclick;
    45      private String _onkeydown;
    46      private String _onkeypress;
    47      private String _onkeyup;
    48      private String _onmousedown;
    49      private String _onmousemove;
    50      private String _onmouseout;
    51      private String _onmouseover;
    52      private String _onmouseup;
    53
    54      public void release() {
    55          super.release();
    56
    57          _dir=null;
    58          _lang=null;
    59          _style=null;
    60          _styleClass=null;
    61          _title=null;
    62          _onclick=null;
    63          _ondblclick=null;
    64          _onkeydown=null;
    65          _onkeypress=null;
    66          _onkeyup=null;
    67          _onmousedown=null;
    68          _onmousemove=null;
    69          _onmouseout=null;
    70          _onmouseover=null;
    71          _onmouseup=null;
    72
    73      }
    74
    75      protected void setProperties(UIComponent component)
    76      {
    77          super.setProperties(component);
    78          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.DIR_ATTR, _dir);
    79          setStringProperty(component, HTML.LANG_ATTR, _lang);
    80          setStringProperty(component, HTML.STYLE_ATTR, _style);
    81          setStringProperty(component, HTML.TITLE_ATTR, _title);
    82          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.STYLE_CLASS_ATTR, _styleClass);
    83          setStringProperty(component, HTML.ONCLICK_ATTR, _onclick);
    84          setStringProperty(component, HTML.ONDBLCLICK_ATTR, _ondblclick);
    85          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.ONMOUSEDOWN_ATTR, _onmousedown);
    86          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.ONMOUSEUP_ATTR, _onmouseup);
    87          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.ONMOUSEOVER_ATTR, _onmouseover);
    88          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.ONMOUSEMOVE_ATTR, _onmousemove);
    89          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.ONMOUSEOUT_ATTR, _onmouseout);
    90          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.ONKEYPRESS_ATTR, _onkeypress);
    91          setStringProperty(component, HTML.ONKEYDOWN_ATTR, _onkeydown);
    92          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.ONKEYUP_ATTR, _onkeyup);
    93      }
    94
    95      public void setStyleClass(String styleClass)
    96      {
    97          _styleClass = styleClass;
    98      }
    99
    100     public void setDir(String dir)
    101     {
    102         _dir = dir;
    103     }
    104
    105     public void setLang(String lang)
    106     {
    107         _lang = lang;
    108     }
    109
    110     public void setStyle(String style)
    111     {
    112         _style = style;
    113     }
    114
    115     public void setTitle(String title)
    116     {
    117         _title = title;
    118     }
    119
    120     public void setOnclick(String onclick)
    121     {
    122         _onclick = onclick;
    123     }
    124
    125     public void setOndblclick(String ondblclick)
    126     {
    127         _ondblclick = ondblclick;
    128     }
    129
    130     public void setOnmousedown(String onmousedown)
    131     {
    132         _onmousedown = onmousedown;
    133     }
    134
    135     public void setOnmouseup(String onmouseup)
    136     {
    137         _onmouseup = onmouseup;
    138     }
    139
    140     public void setOnmouseover(String onmouseover)
    141     {
    142         _onmouseover = onmouseover;
    143     }
    144
    145     public void setOnmousemove(String onmousemove)
    146     {
    147         _onmousemove = onmousemove;
    148     }
    149
    150     public void setOnmouseout(String onmouseout)
    151     {
    152         _onmouseout = onmouseout;
    153     }
    154
    155     public void setOnkeypress(String onkeypress)
    156     {
    157         _onkeypress = onkeypress;
    158     }
    159
    160     public void setOnkeydown(String onkeydown)
    161     {
    162         _onkeydown = onkeydown;
    163     }
    164
    165     public void setOnkeyup(String onkeyup)
    166     {
    167         _onkeyup = onkeyup;
    168     }
    169 }