Source Code Cross Referenced for AlertBean.java in  » ESB » open-esb » com » sun » jbi » jsf » bean » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » ESB » open esb » com.sun.jbi.jsf.bean 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003:         *
004:         *  Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
005:         *
006:         *  The contents of this file are subject to the terms of either the GNU
007:         *  General Public License Version 2 only ("GPL") or the Common Development
008:         *  and Distribution License("CDDL") (collectively, the "License").  You
009:         *  may not use this file except in compliance with the License. You can obtain
010:         *  a copy of the License at https://glassfish.dev.java.net/public/CDDL+GPL.html
011:         *  or glassfish/bootstrap/legal/LICENSE.txt.  See the License for the specific
012:         *  language governing permissions and limitations under the License.
013:         *
014:         *  When distributing the software, include this License Header Notice in each
015:         *  file and include the License file at glassfish/bootstrap/legal/LICENSE.txt.
016:         *  Sun designates this particular file as subject to the "Classpath" exception
017:         *  as provided by Sun in the GPL Version 2 section of the License file that
018:         *  accompanied this code.  If applicable, add the following below the License
019:         *  Header, with the fields enclosed by brackets [] replaced by your own
020:         *  identifying information: "Portions Copyrighted [year]
021:         *  [name of copyright owner]"
022:         *
023:         *  Contributor(s):
024:         *
025:         *  If you wish your version of this file to be governed by only the CDDL or
026:         *  only the GPL Version 2, indicate your decision by adding "[Contributor]
027:         *  elects to include this software in this distribution under the [CDDL or GPL
028:         *  Version 2] license."  If you don't indicate a single choice of license, a
029:         *  recipient has the option to distribute your version of this file under
030:         *  either the CDDL, the GPL Version 2 or to extend the choice of license to
031:         *  its licensees as provided above.  However, if you add GPL Version 2 code
032:         *  and therefore, elected the GPL Version 2 license, then the option applies
033:         *  only if the new code is made subject to such option by the copyright
034:         *  holder.
035:         */
036:        /*
037:         *  AlertBean.java
038:         */
039:        package com.sun.jbi.jsf.bean;
040:
041:        import com.sun.jbi.jsf.util.JBILogger;
042:
043:        /**
044:         * Holds alert type (for icon display), summary, details, and display state.
045:         *
046:         * @author   Sun Microsystems Inc.
047:         */
048:        public class AlertBean {
049:
050:            /**
051:             * Tracks display of an alert
052:             */
053:            public static final int ALERT_COUNT_NONE = 0;
054:
055:            /**
056:             * Represents emptied details
057:             */
058:            public static final String ALERT_DETAIL_NONE = "";
059:            // not I18n
060:
061:            /**
062:             * Represents emptied summary
063:             */
064:            public static final String ALERT_SUMMARY_NONE = "";
065:            // not I18n
066:
067:            /**
068:             * <code>error</code> icon alert display
069:             */
070:            public static final String ALERT_TYPE_ERROR = "error";
071:            // not I18n
072:
073:            /**
074:             * <code>info</code> icon alert display
075:             */
076:            public static final String ALERT_TYPE_INFO = "info";
077:            // not I18n
078:
079:            /**
080:             * an uninitialized alert type
081:             */
082:            public static final String ALERT_TYPE_NONE = "";
083:            // not I18n
084:
085:            /**
086:             * <code>warning</code> icon alert display
087:             */
088:            public static final String ALERT_TYPE_WARNING = "warning";
089:
090:            // not I18n
091:
092:            /**
093:             * Gets the count to determine if the alert needs to be, or already has
094:             * been, displayed.
095:             *
096:             * @return   zero if there is no need to display the alert
097:             */
098:            public int getAlertCount() {
099:                if (JBILogger.isLoggableFiner()) {
100:                    JBILogger.logFiner(CN, MN_GET_ALERT_COUNT, "mAlertCount="
101:                            + mAlertCount);
102:                }
103:                return mAlertCount;
104:            }
105:
106:            /**
107:             * Gets alert details
108:             *
109:             * @return   the I18n details to display in an alert
110:             */
111:            public String getAlertDetail() {
112:                if (JBILogger.isLoggableFiner()) {
113:                    JBILogger.logFiner(CN, MN_GET_ALERT_DETAIL, "mAlertDetail="
114:                            + mAlertDetail);
115:                }
116:                return mAlertDetail;
117:            }
118:
119:            /**
120:             * Gets alert summary
121:             *
122:             * @return   the I18n summary to display in an alert
123:             */
124:            public String getAlertSummary() {
125:                if (JBILogger.isLoggableFiner()) {
126:                    JBILogger.logFiner(CN, MN_GET_ALERT_SUMMARY,
127:                            "mAlertSummary=" + mAlertSummary);
128:                }
129:                return mAlertSummary;
130:            }
131:
132:            /**
133:             * Gets alert type
134:             *
135:             * @return   the type of alert icon to display, one of: <code>info</code>,
136:             *      <code>warning</code>, <code>error</code> (defaults to <code>error</code>
137:             *      if no alert type was set.
138:             */
139:            public String getAlertType() {
140:                if (ALERT_TYPE_NONE.equals(mAlertType)) {
141:                    mAlertType = ALERT_TYPE_ERROR;
142:                }
143:
144:                if (JBILogger.isLoggableFiner()) {
145:                    JBILogger.logFiner(CN, MN_GET_ALERT_TYPE, "mAlertType="
146:                            + mAlertType);
147:                }
148:
149:                return mAlertType;
150:            }
151:
152:            /**
153:             * Sets the count
154:             *
155:             * @param anAlertCount  the new count, nonzero if the alert is to be
156:             *      displayed, and zero when the alert has been displayed.
157:             */
158:            public void setAlertCount(int anAlertCount) {
159:                mAlertCount = anAlertCount;
160:                if (JBILogger.isLoggableFiner()) {
161:                    JBILogger.logFiner(CN, MN_SET_ALERT_COUNT, "mAlertCount="
162:                            + mAlertCount);
163:                }
164:            }
165:
166:            /**
167:             * Sets the details
168:             *
169:             * @param aAlertDetail  an I18n details message string
170:             */
171:            public void setAlertDetail(String aAlertDetail) {
172:                if (JBILogger.isLoggableFiner()) {
173:                    JBILogger.logFiner(CN, MN_SET_ALERT_DETAIL, "mAlertDetail="
174:                            + mAlertDetail);
175:                }
176:                mAlertDetail = aAlertDetail;
177:            }
178:
179:            /**
180:             * Sets summary
181:             *
182:             * @param aAlertSummary  the I18n summary message string
183:             */
184:            public void setAlertSummary(String aAlertSummary) {
185:                if (JBILogger.isLoggableFiner()) {
186:                    JBILogger.logFiner(CN, MN_SET_ALERT_SUMMARY,
187:                            "mAlertSummary=" + mAlertSummary);
188:                }
189:                mAlertSummary = aAlertSummary;
190:            }
191:
192:            /**
193:             * Sets the type of icon to display
194:             *
195:             * @param aAlertType  an icon type, one of: <code>info</code>, <code>warning</code>
196:             *      , or <code>error</code>. If not set, the icon defaults to <code>error</code>
197:             *      .
198:             */
199:            public void setAlertType(String aAlertType) {
200:                if (JBILogger.isLoggableFiner()) {
201:                    JBILogger.logFiner(CN, MN_SET_ALERT_TYPE, "mAlertType="
202:                            + mAlertType);
203:                }
204:                mAlertType = aAlertType;
205:            }
206:
207:            private static final String CN = AlertBean.class.getName();
208:            private static final String MN_GET_ALERT_COUNT = "getAlertCount()";
209:            private static final String MN_GET_ALERT_DETAIL = "getAlertDetail()";
210:            private static final String MN_GET_ALERT_SUMMARY = "getAlertSummary()";
211:            private static final String MN_GET_ALERT_TYPE = "getAlertType()";
212:            private static final String MN_SET_ALERT_COUNT = "setAlertCount()";
213:            private static final String MN_SET_ALERT_DETAIL = "setAlertDetail()";
214:            private static final String MN_SET_ALERT_SUMMARY = "setAlertSummary()";
215:            private static final String MN_SET_ALERT_TYPE = "setAlertType()";
216:
217:            private int mAlertCount = ALERT_COUNT_NONE;
218:            private String mAlertDetail = ALERT_DETAIL_NONE;
219:            private String mAlertSummary = ALERT_SUMMARY_NONE;
220:            private String mAlertType = ALERT_TYPE_NONE;
221:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.