Source Code Cross Referenced for StatusInfo.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » texteditor » templates » 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 » IDE Eclipse » ui workbench » org.eclipse.ui.texteditor.templates 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.ui.texteditor.templates;
011:
012:        import org.eclipse.core.runtime.Assert;
013:        import org.eclipse.core.runtime.IStatus;
014:
015:        import org.eclipse.ui.internal.texteditor.TextEditorPlugin;
016:
017:        /**
018:         * A settable IStatus.
019:         * Can be an error, warning, info or OKk. For error, info and warning states,
020:         * a message describes the problem.
021:         *
022:         * @since 3.0
023:         */
024:        class StatusInfo implements  IStatus {
025:
026:            private String fStatusMessage;
027:            private int fSeverity;
028:
029:            /**
030:             * Creates a status set to OK (no message)
031:             */
032:            public StatusInfo() {
033:                this (OK, null);
034:            }
035:
036:            /**
037:             * Creates a status .
038:             * @param severity The status severity: ERROR, WARNING, INFO and OK.
039:             * @param message The message of the status. Applies only for ERROR,
040:             * WARNING and INFO.
041:             */
042:            public StatusInfo(int severity, String message) {
043:                fStatusMessage = message;
044:                fSeverity = severity;
045:            }
046:
047:            /**
048:             * Returns if the status' severity is OK.
049:             *
050:             * @return <code>true</code> if the status' severity is OK
051:             */
052:            public boolean isOK() {
053:                return fSeverity == IStatus.OK;
054:            }
055:
056:            /**
057:             * Returns if the status' severity is WARNING.
058:             *
059:             * @return <code>true</code> if the status' severity is WARNING
060:             */
061:            public boolean isWarning() {
062:                return fSeverity == IStatus.WARNING;
063:            }
064:
065:            /**
066:             *  Returns if the status' severity is INFO.
067:             *
068:             * @return <code>true</code> if the status' severity is INFO
069:             */
070:            public boolean isInfo() {
071:                return fSeverity == IStatus.INFO;
072:            }
073:
074:            /**
075:             *  Returns if the status' severity is ERROR.
076:             *
077:             * @return <code>true</code> if the status' severity is ERROR
078:             */
079:            public boolean isError() {
080:                return fSeverity == IStatus.ERROR;
081:            }
082:
083:            /**
084:             * Returns the message.
085:             *
086:             * @return the message
087:             * @see IStatus#getMessage()
088:             */
089:            public String getMessage() {
090:                return fStatusMessage;
091:            }
092:
093:            /**
094:             * Sets the status to ERROR.
095:             * @param errorMessage the error message (can be empty, but not null)
096:             */
097:            public void setError(String errorMessage) {
098:                Assert.isNotNull(errorMessage);
099:                fStatusMessage = errorMessage;
100:                fSeverity = IStatus.ERROR;
101:            }
102:
103:            /**
104:             * Sets the status to WARNING.
105:             * @param warningMessage the warning message (can be empty, but not null)
106:             */
107:            public void setWarning(String warningMessage) {
108:                Assert.isNotNull(warningMessage);
109:                fStatusMessage = warningMessage;
110:                fSeverity = IStatus.WARNING;
111:            }
112:
113:            /**
114:             * Sets the status to INFO.
115:             * @param infoMessage the info message (can be empty, but not null)
116:             */
117:            public void setInfo(String infoMessage) {
118:                Assert.isNotNull(infoMessage);
119:                fStatusMessage = infoMessage;
120:                fSeverity = IStatus.INFO;
121:            }
122:
123:            /**
124:             * Sets the status to OK.
125:             */
126:            public void setOK() {
127:                fStatusMessage = null;
128:                fSeverity = IStatus.OK;
129:            }
130:
131:            /*
132:             * @see IStatus#matches(int)
133:             */
134:            public boolean matches(int severityMask) {
135:                return (fSeverity & severityMask) != 0;
136:            }
137:
138:            /**
139:             * Returns always <code>false</code>.
140:             * @see IStatus#isMultiStatus()
141:             */
142:            public boolean isMultiStatus() {
143:                return false;
144:            }
145:
146:            /*
147:             * @see IStatus#getSeverity()
148:             */
149:            public int getSeverity() {
150:                return fSeverity;
151:            }
152:
153:            /*
154:             * @see IStatus#getPlugin()
155:             */
156:            public String getPlugin() {
157:                return TextEditorPlugin.PLUGIN_ID;
158:            }
159:
160:            /**
161:             * Returns always <code>null</code>.
162:             * @see IStatus#getException()
163:             */
164:            public Throwable getException() {
165:                return null;
166:            }
167:
168:            /**
169:             * Returns always the error severity.
170:             * @see IStatus#getCode()
171:             */
172:            public int getCode() {
173:                return fSeverity;
174:            }
175:
176:            /**
177:             * Returns always <code>null</code>.
178:             * @see IStatus#getChildren()
179:             */
180:            public IStatus[] getChildren() {
181:                return new IStatus[0];
182:            }
183:
184:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.