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
    23  import javax.faces.component.UIComponent;
    24
    25  /**
    26   * @author Manfred Geiler (latest modification by $Author: grantsmith $)
    27   * @version $Revision: 472630 $ $Date: 2006-11-08 15:40:03 -0500 (Wed, 08 Nov 2006) $
    28   */
    29  public abstract class HtmlMessagesTagBase
    30          extends org.apache.myfaces.shared_orchestra.taglib.html.HtmlComponentTagBase
    31  {
    32      //private static final Log log = LogFactory.getLog(HtmlOutputFormatTag.class);
    33
    34      // UIComponent attributes --> already implemented in UIComponentTagBase
    35
    36      // user role attributes --> already implemented in UIComponentTagBase
    37
    38      // HTML universal attributes --> already implemented in HtmlComponentTagBase
    39
    40      // HTML event handler attributes --> already implemented in HtmlComponentTagBase
    41
    42      // UIMessages attributes
    43      private String _showSummary;
    44      private String _showDetail;
    45      private String _globalOnly;
    46
    47      // HtmlMessages attributes
    48      private String _infoClass;
    49      private String _infoStyle;
    50      private String _warnClass;
    51      private String _warnStyle;
    52      private String _errorClass;
    53      private String _errorStyle;
    54      private String _fatalClass;
    55      private String _fatalStyle;
    56      private String _layout;
    57      private String _tooltip;
    58
    59      public void release() {
    60          super.release();
    61          _showSummary=null;
    62          _showDetail=null;
    63          _globalOnly=null;
    64          _infoClass=null;
    65          _infoStyle=null;
    66          _warnClass=null;
    67          _warnStyle=null;
    68          _errorClass=null;
    69          _errorStyle=null;
    70          _fatalClass=null;
    71          _fatalStyle=null;
    72          _layout=null;
    73          _tooltip=null;
    74      }
    75
    76      protected void setProperties(UIComponent component)
    77      {
    78          super.setProperties(component);
    79
    80          setBooleanProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.SHOW_SUMMARY_ATTR, _showSummary);
    81          setBooleanProperty(component, JSFAttr.SHOW_DETAIL_ATTR, _showDetail);
    82          setBooleanProperty(component, JSFAttr.GLOBAL_ONLY_ATTR, _globalOnly);
    83
    84          setStringProperty(component, JSFAttr.INFO_CLASS_ATTR, _infoClass);
    85          setStringProperty(component, JSFAttr.INFO_STYLE_ATTR, _infoStyle);
    86          setStringProperty(component, JSFAttr.WARN_CLASS_ATTR, _warnClass);
    87          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.WARN_STYLE_ATTR, _warnStyle);
    88          setStringProperty(component, JSFAttr.ERROR_CLASS_ATTR, _errorClass);
    89          setStringProperty(component, JSFAttr.ERROR_STYLE_ATTR, _errorStyle);
    90          setStringProperty(component, JSFAttr.FATAL_CLASS_ATTR, _fatalClass);
    91          setStringProperty(component, JSFAttr.FATAL_STYLE_ATTR, _fatalStyle);
    92          setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.LAYOUT_ATTR, _layout);
    93          setBooleanProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.TOOLTIP_ATTR, _tooltip);
    94      }
    95
    96      public void setShowSummary(String showSummary)
    97      {
    98          _showSummary = showSummary;
    99      }
    100
    101     public void setShowDetail(String showDetail)
    102     {
    103         _showDetail = showDetail;
    104     }
    105
    106     public void setGlobalOnly(String globalOnly)
    107     {
    108         _globalOnly = globalOnly;
    109     }
    110
    111     public void setErrorClass(String errorClass)
    112     {
    113         _errorClass = errorClass;
    114     }
    115
    116     public void setErrorStyle(String errorStyle)
    117     {
    118         _errorStyle = errorStyle;
    119     }
    120
    121     public void setFatalClass(String fatalClass)
    122     {
    123         _fatalClass = fatalClass;
    124     }
    125
    126     public void setFatalStyle(String fatalStyle)
    127     {
    128         _fatalStyle = fatalStyle;
    129     }
    130
    131     public void setInfoClass(String infoClass)
    132     {
    133         _infoClass = infoClass;
    134     }
    135
    136     public void setInfoStyle(String infoStyle)
    137     {
    138         _infoStyle = infoStyle;
    139     }
    140
    141     public void setWarnClass(String warnClass)
    142     {
    143         _warnClass = warnClass;
    144     }
    145
    146     public void setWarnStyle(String warnStyle)
    147     {
    148         _warnStyle = warnStyle;
    149     }
    150
    151     public void setLayout(String layout)
    152     {
    153         _layout = layout;
    154     }
    155
    156     public void setTooltip(String tooltip)
    157     {
    158         _tooltip = tooltip;
    159     }
    160 }