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.taglib.html;
20  
21  import org.apache.myfaces.shared.renderkit.html.HTML;
22  
23  import javax.el.ValueExpression;
24  import javax.faces.component.UIComponent;
25  
26  
27  /***
28   * @author Manfred Geiler (latest modification by $Author: cagatay $)
29   * @author Martin Marinschek
30   * @version $Revision: 606793 $ $Date: 2007-12-25 10:20:46 -0500 (Tue, 25 Dec 2007) $
31   */
32  public abstract class HtmlSelectManyCheckboxELTagBase
33          extends org.apache.myfaces.shared.taglib.html.HtmlInputELTagBase
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 input attributes relevant for checkbox-list
44      private ValueExpression _accesskey;
45      private ValueExpression _alt;
46      private ValueExpression _datafld;
47      private ValueExpression _datasrc;
48      private ValueExpression _dataformatas;
49      private ValueExpression _disabled;
50      private ValueExpression _onblur;
51      private ValueExpression _onchange;
52      private ValueExpression _onfocus;
53      private ValueExpression _onselect;
54      private ValueExpression _readonly;
55      private ValueExpression _size; //TODO: needed?
56      private ValueExpression _tabindex;
57  
58      // UIInput attributes
59      // --> already implemented in HtmlInputTagBase
60  
61      // UISelectMany attributes
62      //selectedValues cannot be set here, is set in JSP-parsing
63  
64      // HTMLSelectManyAttributes attributes
65      private ValueExpression _disabledClass;
66      private ValueExpression _enabledClass;
67      private ValueExpression _layout;
68  
69      //FIXME: here there is no border element, in the others
70      // (HTMLSelectOneMenuTag, HtmlSelectOneRadioTag)
71      //  there is... inconsistent...
72      //private String _border;
73  
74  
75      public void release() {
76          super.release();
77          _accesskey=null;
78          _alt=null;
79          _datafld=null;
80          _datasrc=null;
81          _dataformatas=null;
82          _disabled=null;
83          _onblur=null;
84          _onchange=null;
85          _onfocus=null;
86          _onselect=null;
87          _readonly=null;
88          _size=null;
89          _tabindex=null;
90          _disabledClass=null;
91          _enabledClass=null;
92          _layout=null;
93      }
94  
95      protected void setProperties(UIComponent component)
96      {
97          super.setProperties(component);
98  
99          setStringProperty(component, org.apache.myfaces.shared.renderkit.html.HTML.ACCESSKEY_ATTR, _accesskey);
100         setStringProperty(component, HTML.ALT_ATTR, _alt);
101         setBooleanProperty(component, org.apache.myfaces.shared.renderkit.html.HTML.DISABLED_ATTR, _disabled);
102         setStringProperty(component, HTML.ONBLUR_ATTR, _onblur);
103         setStringProperty(component, HTML.ONCHANGE_ATTR, _onchange);
104         setStringProperty(component, HTML.ONFOCUS_ATTR, _onfocus);
105         setStringProperty(component, HTML.ONSELECT_ATTR, _onselect);
106         setBooleanProperty(component, HTML.READONLY_ATTR, _readonly);
107         setIntegerProperty(component, HTML.SIZE_ATTR, _size);
108         setStringProperty(component, HTML.TABINDEX_ATTR, _tabindex);
109 
110         setStringProperty(component, org.apache.myfaces.shared.renderkit.JSFAttr.DISABLED_CLASS_ATTR, _disabledClass);
111         setStringProperty(component, org.apache.myfaces.shared.renderkit.JSFAttr.ENABLED_CLASS_ATTR, _enabledClass);
112         setStringProperty(component, org.apache.myfaces.shared.renderkit.JSFAttr.LAYOUT_ATTR, _layout);
113    }
114 
115     public void setAccesskey(ValueExpression accesskey)
116     {
117         _accesskey = accesskey;
118     }
119 
120     public void setAlt(ValueExpression alt)
121     {
122         _alt = alt;
123     }
124 
125     public void setDatafld(ValueExpression datafld)
126     {
127         _datafld = datafld;
128     }
129 
130     public void setDatasrc(ValueExpression datasrc)
131     {
132         _datasrc = datasrc;
133     }
134 
135     public void setDataformatas(ValueExpression dataformatas)
136     {
137         _dataformatas = dataformatas;
138     }
139 
140     public void setDisabled(ValueExpression disabled)
141     {
142         _disabled = disabled;
143     }
144 
145     public void setOnblur(ValueExpression onblur)
146     {
147         _onblur = onblur;
148     }
149 
150     public void setOnchange(ValueExpression onchange)
151     {
152         _onchange = onchange;
153     }
154 
155     public void setOnfocus(ValueExpression onfocus)
156     {
157         _onfocus = onfocus;
158     }
159 
160     public void setOnselect(ValueExpression onselect)
161     {
162         _onselect = onselect;
163     }
164 
165     public void setReadonly(ValueExpression readonly)
166     {
167         _readonly = readonly;
168     }
169 
170     public void setSize(ValueExpression size)
171     {
172         _size = size;
173     }
174 
175     public void setTabindex(ValueExpression tabindex)
176     {
177         _tabindex = tabindex;
178     }
179 
180     public void setDisabledClass(ValueExpression disabledClass)
181     {
182         _disabledClass = disabledClass;
183     }
184 
185     public void setEnabledClass(ValueExpression enabledClass)
186     {
187         _enabledClass = enabledClass;
188     }
189 
190     public void setLayout(ValueExpression layout)
191     {
192         _layout = layout;
193     }
194 }