01: /*
02: * Copyright 2004-2006 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.apache.myfaces.taglib.core;
17:
18: import javax.el.ValueExpression;
19: import javax.faces.component.UIComponent;
20: import javax.faces.component.UISelectItems;
21: import javax.faces.webapp.UIComponentELTag;
22:
23: /**
24: * @author Manfred Geiler (latest modification by $Author: baranda $)
25: * @version $Revision: 533205 $ $Date: 2007-04-27 22:08:36 +0200 (Fr, 27 Apr 2007) $
26: */
27: public class SelectItemsTag extends UIComponentELTag {
28: //private static final Log log = LogFactory.getLog(SelectItemsTag.class);
29:
30: private ValueExpression _value;
31:
32: public void setValue(ValueExpression value) {
33: this ._value = value;
34: }
35:
36: public String getComponentType() {
37: return "javax.faces.SelectItems";
38: }
39:
40: public String getRendererType() {
41: return null;
42: }
43:
44: protected void setProperties(UIComponent component) {
45: super .setProperties(component);
46:
47: if (_value != null) {
48: if (!_value.isLiteralText()) {
49: component.setValueExpression("value", _value);
50: } else {
51: ((UISelectItems) component).setValue(_value
52: .getExpressionString());
53: }
54: }
55: }
56:
57: // UISelectItems attributes
58: // --> binding, id, value already handled by UIComponentTagBase
59:
60: }
|