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   * @author Thomas Spiegl (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 HtmlDataTableTagBase
    31          extends org.apache.myfaces.shared_orchestra.taglib.html.HtmlComponentBodyTagBase
    32  {
    33      //private static final Log log = LogFactory.getLog(MyfacesHtmlDataTableTag.class);
    34
    35      // UIComponent attributes --> already implemented in UIComponentTagBase
    36
    37      // user role attributes --> already implemented in UIComponentTagBase
    38
    39      // HTML universal attributes --> already implemented in HtmlComponentTagBase
    40
    41      // HTML event handler attributes --> already implemented in HtmlComponentTagBase
    42
    43      // HTML table attributes relevant for Table
    44      private String _align;
    45      private String _border;
    46      private String _bgcolor;
    47      private String _cellpadding;
    48      private String _cellspacing;
    49      private String _datafld;
    50      private String _datasrc;
    51      private String _dataformatas;
    52      private String _frame;
    53      private String _rules;
    54      private String _summary;
    55      private String _width;
    56
    57      // UIPanel attributes
    58      // value and converterId --> already implemented in UIComponentTagBase
    59
    60      // HtmlPanelGrid attributes
    61      private String _columnClasses;
    62      private String _columns;
    63      private String _footerClass;
    64      private String _headerClass;
    65      private String _rowClasses;
    66
    67      // UIData attributes
    68      private String _rows;
    69      private String _var;
    70      private String _first;
    71
    72      public void release() {
    73          super.release();
    74          _align=null;
    75          _border=null;
    76          _bgcolor=null;
    77          _cellpadding=null;
    78          _cellspacing=null;
    79          _datafld=null;
    80          _datasrc=null;
    81          _dataformatas=null;
    82          _frame=null;
    83          _rules=null;
    84          _summary=null;
    85          _width=null;
    86          _columnClasses=null;
    87          _columns=null;
    88          _footerClass=null;
    89          _headerClass=null;
    90          _rowClasses=null;
    91          _rows=null;
    92          _var=null;
    93          _first=null;
    94      }
    95
    96      protected void setProperties(UIComponent component)
    97      {
    98          super.setProperties(component);
    99
    100         setStringProperty(component, HTML.ALIGN_ATTR, _align);
    101         setIntegerProperty(component, HTML.BORDER_ATTR, _border);
    102         setStringProperty(component, HTML.BGCOLOR_ATTR, _bgcolor);
    103         setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.CELLPADDING_ATTR, _cellpadding);
    104         setStringProperty(component, HTML.CELLSPACING_ATTR, _cellspacing);
    105         setStringProperty(component, HTML.DATAFLD_ATTR, _datafld);
    106         setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.DATASRC_ATTR, _datasrc);
    107         setStringProperty(component, HTML.DATAFORMATAS_ATTR, _dataformatas);
    108         setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.html.HTML.FRAME_ATTR, _frame);
    109         setStringProperty(component, HTML.RULES_ATTR, _rules);
    110         setStringProperty(component, HTML.SUMMARY_ATTR, _summary);
    111         setStringProperty(component, HTML.WIDTH_ATTR, _width);
    112
    113         setStringProperty(component, JSFAttr.COLUMN_CLASSES_ATTR, _columnClasses);
    114         setIntegerProperty(component, JSFAttr.COLUMNS_ATTR, _columns);
    115         setStringProperty(component, JSFAttr.FOOTER_CLASS_ATTR, _footerClass);
    116         setStringProperty(component, org.apache.myfaces.shared_orchestra.renderkit.JSFAttr.HEADER_CLASS_ATTR, _headerClass);
    117         setStringProperty(component, JSFAttr.ROW_CLASSES_ATTR, _rowClasses);
    118
    119         setIntegerProperty(component, JSFAttr.ROWS_ATTR, _rows);
    120         setStringProperty(component, JSFAttr.VAR_ATTR, _var);
    121         setIntegerProperty(component, JSFAttr.FIRST_ATTR, _first);
    122     }
    123
    124
    125
    126     public void setAlign(String align)
    127     {
    128         _align = align;
    129     }
    130
    131     public void setBorder(String border)
    132     {
    133         _border = border;
    134     }
    135
    136     public void setBgcolor(String bgcolor)
    137     {
    138         _bgcolor = bgcolor;
    139     }
    140
    141     public void setCellpadding(String cellpadding)
    142     {
    143         _cellpadding = cellpadding;
    144     }
    145
    146     public void setCellspacing(String cellspacing)
    147     {
    148         _cellspacing = cellspacing;
    149     }
    150
    151     public void setDatafld(String datafld)
    152     {
    153         _datafld = datafld;
    154     }
    155
    156     public void setDatasrc(String datasrc)
    157     {
    158         _datasrc = datasrc;
    159     }
    160
    161     public void setDataformatas(String dataformatas)
    162     {
    163         _dataformatas = dataformatas;
    164     }
    165
    166     public void setFrame(String frame)
    167     {
    168         _frame = frame;
    169     }
    170
    171     public void setRules(String rules)
    172     {
    173         _rules = rules;
    174     }
    175
    176     public void setSummary(String summary)
    177     {
    178         _summary = summary;
    179     }
    180
    181     public void setWidth(String width)
    182     {
    183         _width = width;
    184     }
    185
    186     public void setColumnClasses(String columnClasses)
    187     {
    188         _columnClasses = columnClasses;
    189     }
    190
    191     public void setColumns(String columns)
    192     {
    193         _columns = columns;
    194     }
    195
    196     public void setFooterClass(String footerClass)
    197     {
    198         _footerClass = footerClass;
    199     }
    200
    201     public void setHeaderClass(String headerClass)
    202     {
    203         _headerClass = headerClass;
    204     }
    205
    206     public void setRowClasses(String rowClasses)
    207     {
    208         _rowClasses = rowClasses;
    209     }
    210
    211     public void setRows(String rows)
    212     {
    213         _rows = rows;
    214     }
    215
    216     public void setVar(String var)
    217     {
    218         _var = var;
    219     }
    220
    221     public void setFirst(String first)
    222     {
    223         _first = first;
    224     }
    225 }