View Javadoc

    1   /*
    2    * $Id: AbstractUITag.java 474574 2006-11-13 23:30:17Z hermanns $
    3    *
    4    * Licensed to the Apache Software Foundation (ASF) under one
    5    * or more contributor license agreements.  See the NOTICE file
    6    * distributed with this work for additional information
    7    * regarding copyright ownership.  The ASF licenses this file
    8    * to you under the Apache License, Version 2.0 (the
    9    * "License"); you may not use this file except in compliance
    10   * with the License.  You may obtain a copy of the License at
    11   *
    12   *  http://www.apache.org/licenses/LICENSE-2.0
    13   *
    14   * Unless required by applicable law or agreed to in writing,
    15   * software distributed under the License is distributed on an
    16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    17   * KIND, either express or implied.  See the License for the
    18   * specific language governing permissions and limitations
    19   * under the License.
    20   */
    21  package org.apache.struts2.views.jsp.ui;
    22
    23  import org.apache.struts2.components.UIBean;
    24  import org.apache.struts2.views.jsp.ComponentTagSupport;
    25
    26
    27  /***
    28   * Abstract base class for all UI tags.
    29   *
    30   */
    31  public abstract class AbstractUITag extends ComponentTagSupport {
    32      protected String cssClass;
    33      protected String cssStyle;
    34      protected String title;
    35      protected String disabled;
    36      protected String label;
    37      protected String labelPosition;
    38      protected String requiredposition;
    39      protected String name;
    40      protected String required;
    41      protected String tabindex;
    42      protected String value;
    43      protected String template;
    44      protected String theme;
    45      protected String templateDir;
    46      protected String onclick;
    47      protected String ondblclick;
    48      protected String onmousedown;
    49      protected String onmouseup;
    50      protected String onmouseover;
    51      protected String onmousemove;
    52      protected String onmouseout;
    53      protected String onfocus;
    54      protected String onblur;
    55      protected String onkeypress;
    56      protected String onkeydown;
    57      protected String onkeyup;
    58      protected String onselect;
    59      protected String onchange;
    60      protected String accesskey;
    61
    62      protected String key;
    63
    64      // tooltip attributes
    65      protected String tooltip;
    66      protected String tooltipConfig;
    67
    68
    69      protected void populateParams() {
    70          super.populateParams();
    71
    72          UIBean uiBean = (UIBean) component;
    73          uiBean.setCssClass(cssClass);
    74          uiBean.setCssClass(cssClass);
    75          uiBean.setCssStyle(cssStyle);
    76          uiBean.setTitle(title);
    77          uiBean.setDisabled(disabled);
    78          uiBean.setLabel(label);
    79          uiBean.setLabelposition(labelPosition);
    80          uiBean.setRequiredposition(requiredposition);
    81          uiBean.setName(name);
    82          uiBean.setRequired(required);
    83          uiBean.setTabindex(tabindex);
    84          uiBean.setValue(value);
    85          uiBean.setTemplate(template);
    86          uiBean.setTheme(theme);
    87          uiBean.setTemplateDir(templateDir);
    88          uiBean.setOnclick(onclick);
    89          uiBean.setOndblclick(ondblclick);
    90          uiBean.setOnmousedown(onmousedown);
    91          uiBean.setOnmouseup(onmouseup);
    92          uiBean.setOnmouseover(onmouseover);
    93          uiBean.setOnmousemove(onmousemove);
    94          uiBean.setOnmouseout(onmouseout);
    95          uiBean.setOnfocus(onfocus);
    96          uiBean.setOnblur(onblur);
    97          uiBean.setOnkeypress(onkeypress);
    98          uiBean.setOnkeydown(onkeydown);
    99          uiBean.setOnkeyup(onkeyup);
    100         uiBean.setOnselect(onselect);
    101         uiBean.setOnchange(onchange);
    102         uiBean.setTooltip(tooltip);
    103         uiBean.setTooltipConfig(tooltipConfig);
    104         uiBean.setAccesskey(accesskey);
    105         uiBean.setKey(key);
    106     }
    107
    108     public void setCssClass(String cssClass) {
    109         this.cssClass = cssClass;
    110     }
    111
    112     public void setCssStyle(String cssStyle) {
    113         this.cssStyle = cssStyle;
    114     }
    115
    116     public void setTitle(String title) {
    117         this.title = title;
    118     }
    119
    120     public void setDisabled(String disabled) {
    121         this.disabled = disabled;
    122     }
    123
    124     public void setLabel(String label) {
    125         this.label = label;
    126     }
    127
    128     public void setLabelposition(String labelPosition) {
    129         this.labelPosition = labelPosition;
    130     }
    131
    132     public void setRequiredposition(String requiredPosition) {
    133         this.requiredposition = requiredPosition;
    134     }
    135
    136     public void setName(String name) {
    137         this.name = name;
    138     }
    139
    140     public void setRequired(String required) {
    141         this.required = required;
    142     }
    143
    144     public void setTabindex(String tabindex) {
    145         this.tabindex = tabindex;
    146     }
    147
    148     public void setValue(String value) {
    149         this.value = value;
    150     }
    151
    152     public void setTemplateDir(String templateDir) {
    153         this.templateDir = templateDir;
    154     }
    155
    156     public void setTemplate(String template) {
    157         this.template = template;
    158     }
    159
    160     public void setTheme(String theme) {
    161         this.theme = theme;
    162     }
    163
    164     public void setOnclick(String onclick) {
    165         this.onclick = onclick;
    166     }
    167
    168     public void setOndblclick(String ondblclick) {
    169         this.ondblclick = ondblclick;
    170     }
    171
    172     public void setOnmousedown(String onmousedown) {
    173         this.onmousedown = onmousedown;
    174     }
    175
    176     public void setOnmouseup(String onmouseup) {
    177         this.onmouseup = onmouseup;
    178     }
    179
    180     public void setOnmouseover(String onmouseover) {
    181         this.onmouseover = onmouseover;
    182     }
    183
    184     public void setOnmousemove(String onmousemove) {
    185         this.onmousemove = onmousemove;
    186     }
    187
    188     public void setOnmouseout(String onmouseout) {
    189         this.onmouseout = onmouseout;
    190     }
    191
    192     public void setOnfocus(String onfocus) {
    193         this.onfocus = onfocus;
    194     }
    195
    196     public void setOnblur(String onblur) {
    197         this.onblur = onblur;
    198     }
    199
    200     public void setOnkeypress(String onkeypress) {
    201         this.onkeypress = onkeypress;
    202     }
    203
    204     public void setOnkeydown(String onkeydown) {
    205         this.onkeydown = onkeydown;
    206     }
    207
    208     public void setOnkeyup(String onkeyup) {
    209         this.onkeyup = onkeyup;
    210     }
    211
    212     public void setOnselect(String onselect) {
    213         this.onselect = onselect;
    214     }
    215
    216     public void setOnchange(String onchange) {
    217         this.onchange = onchange;
    218     }
    219
    220     public void setTooltip(String tooltip) {
    221         this.tooltip = tooltip;
    222     }
    223
    224     public void setTooltipConfig(String tooltipConfig) {
    225         this.tooltipConfig = tooltipConfig;
    226     }
    227
    228     public void setAccesskey(String accesskey) {
    229         this.accesskey = accesskey;
    230     }
    231
    232     public void setKey(String key) {
    233         this.key = key;
    234     }
    235 }