001: // WARNING: This file was automatically generated. Do not edit it directly,
002: // or you will lose your changes.
003:
004: /*
005: * Licensed to the Apache Software Foundation (ASF) under one
006: * or more contributor license agreements. See the NOTICE file
007: * distributed with this work for additional information
008: * regarding copyright ownership. The ASF licenses this file
009: * to you under the Apache License, Version 2.0 (the
010: * "License"); you may not use this file except in compliance
011: * with the License. You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing,
016: * software distributed under the License is distributed on an
017: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
018: * KIND, either express or implied. See the License for the
019: * specific language governing permissions and limitations
020: * under the License.
021: */
022: package javax.faces.component;
023:
024: import javax.el.ValueExpression;
025: import javax.faces.context.FacesContext;
026:
027: /**
028: */
029: public class UISelectItem extends UIComponentBase {
030:
031: static public final String COMPONENT_FAMILY = "javax.faces.SelectItem";
032: static public final String COMPONENT_TYPE = "javax.faces.SelectItem";
033:
034: /**
035: * Construct an instance of the UISelectItem.
036: */
037: public UISelectItem() {
038: setRendererType(null);
039: }
040:
041: // Property: value
042: private Object _value;
043:
044: /**
045: * Gets The initial value of this component.
046: *
047: * @return the new value value
048: */
049: public Object getValue() {
050: if (_value != null) {
051: return _value;
052: }
053: ValueExpression expression = getValueExpression("value");
054: if (expression != null) {
055: return expression
056: .getValue(getFacesContext().getELContext());
057: }
058: return null;
059: }
060:
061: /**
062: * Sets The initial value of this component.
063: *
064: * @param value the new value value
065: */
066: public void setValue(Object value) {
067: this ._value = value;
068: }
069:
070: // Property: itemDisabled
071: private boolean _itemDisabled;
072: private boolean _itemDisabledSet;
073:
074: /**
075: * Gets Determine whether this item can be chosen by the user.
076: * When true, this item cannot be chosen by the user. If this method is
077: * ever called, then any EL-binding for the disabled property will be ignored.
078: *
079: * @return the new itemDisabled value
080: */
081: public boolean isItemDisabled() {
082: if (_itemDisabledSet) {
083: return _itemDisabled;
084: }
085: ValueExpression expression = getValueExpression("itemDisabled");
086: if (expression != null) {
087: return (Boolean) expression.getValue(getFacesContext()
088: .getELContext());
089: }
090: return false;
091: }
092:
093: /**
094: * Sets Determine whether this item can be chosen by the user.
095: * When true, this item cannot be chosen by the user. If this method is
096: * ever called, then any EL-binding for the disabled property will be ignored.
097: *
098: * @param itemDisabled the new itemDisabled value
099: */
100: public void setItemDisabled(boolean itemDisabled) {
101: this ._itemDisabled = itemDisabled;
102: this ._itemDisabledSet = true;
103: }
104:
105: // Property: itemEscaped
106: private boolean _itemEscaped;
107: private boolean _itemEscapedSet;
108:
109: /**
110: * Gets The escape setting for the label of this selection item.
111: *
112: * @return the new itemEscaped value
113: */
114: public boolean isItemEscaped() {
115: if (_itemEscapedSet) {
116: return _itemEscaped;
117: }
118: ValueExpression expression = getValueExpression("itemEscaped");
119: if (expression != null) {
120: return (Boolean) expression.getValue(getFacesContext()
121: .getELContext());
122: }
123: return false;
124: }
125:
126: /**
127: * Sets The escape setting for the label of this selection item.
128: *
129: * @param itemEscaped the new itemEscaped value
130: */
131: public void setItemEscaped(boolean itemEscaped) {
132: this ._itemEscaped = itemEscaped;
133: this ._itemEscapedSet = true;
134: }
135:
136: // Property: itemDescription
137: private String _itemDescription;
138:
139: /**
140: * Gets For use in development tools.
141: *
142: * @return the new itemDescription value
143: */
144: public String getItemDescription() {
145: if (_itemDescription != null) {
146: return _itemDescription;
147: }
148: ValueExpression expression = getValueExpression("itemDescription");
149: if (expression != null) {
150: return (String) expression.getValue(getFacesContext()
151: .getELContext());
152: }
153: return null;
154: }
155:
156: /**
157: * Sets For use in development tools.
158: *
159: * @param itemDescription the new itemDescription value
160: */
161: public void setItemDescription(String itemDescription) {
162: this ._itemDescription = itemDescription;
163: }
164:
165: // Property: itemLabel
166: private String _itemLabel;
167:
168: /**
169: * Gets The string which will be presented to the user for this option.
170: *
171: * @return the new itemLabel value
172: */
173: public String getItemLabel() {
174: if (_itemLabel != null) {
175: return _itemLabel;
176: }
177: ValueExpression expression = getValueExpression("itemLabel");
178: if (expression != null) {
179: return (String) expression.getValue(getFacesContext()
180: .getELContext());
181: }
182: return null;
183: }
184:
185: /**
186: * Sets The string which will be presented to the user for this option.
187: *
188: * @param itemLabel the new itemLabel value
189: */
190: public void setItemLabel(String itemLabel) {
191: this ._itemLabel = itemLabel;
192: }
193:
194: // Property: itemValue
195: private Object _itemValue;
196:
197: /**
198: * Gets The value for this Item.
199: *
200: * @return the new itemValue value
201: */
202: public Object getItemValue() {
203: if (_itemValue != null) {
204: return _itemValue;
205: }
206: ValueExpression expression = getValueExpression("itemValue");
207: if (expression != null) {
208: return expression
209: .getValue(getFacesContext().getELContext());
210: }
211: return null;
212: }
213:
214: /**
215: * Sets The value for this Item.
216: *
217: * @param itemValue the new itemValue value
218: */
219: public void setItemValue(Object itemValue) {
220: this ._itemValue = itemValue;
221: }
222:
223: @Override
224: public Object saveState(FacesContext facesContext) {
225: Object[] values = new Object[9];
226: values[0] = super .saveState(facesContext);
227: values[1] = _value;
228: values[2] = _itemDisabled;
229: values[3] = _itemDisabledSet;
230: values[4] = _itemEscaped;
231: values[5] = _itemEscapedSet;
232: values[6] = _itemDescription;
233: values[7] = _itemLabel;
234: values[8] = _itemValue;
235:
236: return values;
237: }
238:
239: @Override
240: public void restoreState(FacesContext facesContext, Object state) {
241: Object[] values = (Object[]) state;
242: super .restoreState(facesContext, values[0]);
243: _value = values[1];
244: _itemDisabled = (Boolean) values[2];
245: _itemDisabledSet = (Boolean) values[3];
246: _itemEscaped = (Boolean) values[4];
247: _itemEscapedSet = (Boolean) values[5];
248: _itemDescription = (String) values[6];
249: _itemLabel = (String) values[7];
250: _itemValue = values[8];
251: }
252:
253: @Override
254: public String getFamily() {
255: return COMPONENT_FAMILY;
256: }
257: }
|