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 UIMessage extends UIComponentBase {
030:
031: static public final String COMPONENT_FAMILY = "javax.faces.Message";
032: static public final String COMPONENT_TYPE = "javax.faces.Message";
033:
034: /**
035: * Construct an instance of the UIMessage.
036: */
037: public UIMessage() {
038: setRendererType("javax.faces.Message");
039: }
040:
041: // Property: for
042: private String _for;
043:
044: /**
045: * Gets The ID of the component the Message should be diplayed for.
046: * <p>
047: * This is a required property on the component.
048: * </p>
049: *
050: * @return the new for value
051: */
052: public String getFor() {
053: if (_for != null) {
054: return _for;
055: }
056: ValueExpression expression = getValueExpression("forParam");
057: if (expression != null) {
058: return (String) expression.getValue(getFacesContext()
059: .getELContext());
060: }
061: return null;
062: }
063:
064: /**
065: * Sets The ID of the component the Message should be diplayed for.
066: * <p>
067: * This is a required property on the component.
068: *
069: * @param forParam the new for value
070: */
071: public void setFor(String forParam) {
072: this ._for = forParam;
073: }
074:
075: // Property: showDetail
076: private boolean _showDetail = true;
077: private boolean _showDetailSet;
078:
079: /**
080: * Gets Indicates that details are shown.
081: *
082: * @return the new showDetail value
083: */
084: public boolean isShowDetail() {
085: if (_showDetailSet) {
086: return _showDetail;
087: }
088: ValueExpression expression = getValueExpression("showDetail");
089: if (expression != null) {
090: return (Boolean) expression.getValue(getFacesContext()
091: .getELContext());
092: }
093: return true;
094: }
095:
096: /**
097: * Sets Indicates that details are shown.
098: *
099: * @param showDetail the new showDetail value
100: */
101: public void setShowDetail(boolean showDetail) {
102: this ._showDetail = showDetail;
103: this ._showDetailSet = true;
104: }
105:
106: // Property: showSummary
107: private boolean _showSummary = false;
108: private boolean _showSummarySet;
109:
110: /**
111: * Gets Indicates that the summary should be included into the Message.
112: *
113: * @return the new showSummary value
114: */
115: public boolean isShowSummary() {
116: if (_showSummarySet) {
117: return _showSummary;
118: }
119: ValueExpression expression = getValueExpression("showSummary");
120: if (expression != null) {
121: return (Boolean) expression.getValue(getFacesContext()
122: .getELContext());
123: }
124: return false;
125: }
126:
127: /**
128: * Sets Indicates that the summary should be included into the Message.
129: *
130: * @param showSummary the new showSummary value
131: */
132: public void setShowSummary(boolean showSummary) {
133: this ._showSummary = showSummary;
134: this ._showSummarySet = true;
135: }
136:
137: @Override
138: public Object saveState(FacesContext facesContext) {
139: Object[] values = new Object[6];
140: values[0] = super .saveState(facesContext);
141: values[1] = _for;
142: values[2] = _showDetail;
143: values[3] = _showDetailSet;
144: values[4] = _showSummary;
145: values[5] = _showSummarySet;
146:
147: return values;
148: }
149:
150: @Override
151: public void restoreState(FacesContext facesContext, Object state) {
152: Object[] values = (Object[]) state;
153: super .restoreState(facesContext, values[0]);
154: _for = (String) values[1];
155: _showDetail = (Boolean) values[2];
156: _showDetailSet = (Boolean) values[3];
157: _showSummary = (Boolean) values[4];
158: _showSummarySet = (Boolean) values[5];
159: }
160:
161: @Override
162: public String getFamily() {
163: return COMPONENT_FAMILY;
164: }
165: }
|