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: import javax.faces.el.ValueBinding;
027:
028: /**
029: */
030: public class UIGraphic extends UIComponentBase {
031:
032: static public final String COMPONENT_FAMILY = "javax.faces.Graphic";
033: static public final String COMPONENT_TYPE = "javax.faces.Graphic";
034:
035: /**
036: * Construct an instance of the UIGraphic.
037: */
038: public UIGraphic() {
039: setRendererType("javax.faces.Image");
040: }
041:
042: private static final String URL_PROPERTY = "url";
043: private static final String VALUE_PROPERTY = "value";
044:
045: public void setUrl(String url) {
046: setValue(url);
047: }
048:
049: public String getUrl() {
050: return (String) getValue();
051: }
052:
053: @Override
054: public ValueExpression getValueExpression(String name) {
055: if (URL_PROPERTY.equals(name)) {
056: return super .getValueExpression(VALUE_PROPERTY);
057: } else {
058: return super .getValueExpression(name);
059: }
060: }
061:
062: @Override
063: public void setValueExpression(String name, ValueExpression binding) {
064: if (URL_PROPERTY.equals(name)) {
065: super .setValueExpression(VALUE_PROPERTY, binding);
066: } else {
067: super .setValueExpression(name, binding);
068: }
069: }
070:
071: // Property: value
072: private Object _value;
073:
074: /**
075: * Gets The value property of the UIGraphic
076: *
077: * @return the new value value
078: */
079: public Object getValue() {
080: if (_value != null) {
081: return _value;
082: }
083: ValueExpression expression = getValueExpression("value");
084: if (expression != null) {
085: return expression
086: .getValue(getFacesContext().getELContext());
087: }
088: return null;
089: }
090:
091: /**
092: * Sets The value property of the UIGraphic
093: *
094: * @param value the new value value
095: */
096: public void setValue(Object value) {
097: this ._value = value;
098: }
099:
100: // Property: url
101: private String _url;
102:
103: @Override
104: public Object saveState(FacesContext facesContext) {
105: Object[] values = new Object[3];
106: values[0] = super .saveState(facesContext);
107: values[1] = _value;
108: values[2] = _url;
109:
110: return values;
111: }
112:
113: @Override
114: public void restoreState(FacesContext facesContext, Object state) {
115: Object[] values = (Object[]) state;
116: super .restoreState(facesContext, values[0]);
117: _value = values[1];
118: _url = (String) values[2];
119: }
120:
121: @Override
122: public String getFamily() {
123: return COMPONENT_FAMILY;
124: }
125: }
|