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