Source Code Cross Referenced for StatusInfo.java in  » IDE-Eclipse » Eclipse-plug-in-development » org » eclipse » pde » internal » ui » parts » 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 » Eclipse plug in development » org.eclipse.pde.internal.ui.parts 
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.pde.internal.ui.parts;
011:
012:        import org.eclipse.core.runtime.Assert;
013:        import org.eclipse.core.runtime.IStatus;
014:        import org.eclipse.pde.internal.ui.IPDEUIConstants;
015:
016:        /**
017:         * A settable IStatus. 
018:         * Can be an error, warning, info or ok. For error, info and warning states,
019:         * a message describes the problem.
020:         */
021:        public class StatusInfo implements  IStatus {
022:
023:            private String fStatusMessage;
024:            private int fSeverity;
025:
026:            /**
027:             * Creates a status set to OK (no message)
028:             */
029:            public StatusInfo() {
030:                this (OK, null);
031:            }
032:
033:            /**
034:             * Creates a status .
035:             * @param severity The status severity: ERROR, WARNING, INFO and OK.
036:             * @param message The message of the status. Applies only for ERROR,
037:             * WARNING and INFO.
038:             */
039:            public StatusInfo(int severity, String message) {
040:                fStatusMessage = message;
041:                fSeverity = severity;
042:            }
043:
044:            /**
045:             *  Returns if the status' severity is OK.
046:             */
047:            public boolean isOK() {
048:                return fSeverity == IStatus.OK;
049:            }
050:
051:            /**
052:             *  Returns if the status' severity is WARNING.
053:             */
054:            public boolean isWarning() {
055:                return fSeverity == IStatus.WARNING;
056:            }
057:
058:            /**
059:             *  Returns if the status' severity is INFO.
060:             */
061:            public boolean isInfo() {
062:                return fSeverity == IStatus.INFO;
063:            }
064:
065:            /**
066:             *  Returns if the status' severity is ERROR.
067:             */
068:            public boolean isError() {
069:                return fSeverity == IStatus.ERROR;
070:            }
071:
072:            /**
073:             * @see IStatus#getMessage
074:             */
075:            public String getMessage() {
076:                return fStatusMessage;
077:            }
078:
079:            /**
080:             * Sets the status to ERROR.
081:             * @param The error message (can be empty, but not null)
082:             */
083:            public void setError(String errorMessage) {
084:                Assert.isNotNull(errorMessage);
085:                fStatusMessage = errorMessage;
086:                fSeverity = IStatus.ERROR;
087:            }
088:
089:            /**
090:             * Sets the status to WARNING.
091:             * @param The warning message (can be empty, but not null)
092:             */
093:            public void setWarning(String warningMessage) {
094:                Assert.isNotNull(warningMessage);
095:                fStatusMessage = warningMessage;
096:                fSeverity = IStatus.WARNING;
097:            }
098:
099:            /**
100:             * Sets the status to INFO.
101:             * @param The info message (can be empty, but not null)
102:             */
103:            public void setInfo(String infoMessage) {
104:                Assert.isNotNull(infoMessage);
105:                fStatusMessage = infoMessage;
106:                fSeverity = IStatus.INFO;
107:            }
108:
109:            /**
110:             * Sets the status to OK.
111:             */
112:            public void setOK() {
113:                fStatusMessage = null;
114:                fSeverity = IStatus.OK;
115:            }
116:
117:            /*
118:             * @see IStatus#matches(int)
119:             */
120:            public boolean matches(int severityMask) {
121:                return (fSeverity & severityMask) != 0;
122:            }
123:
124:            /**
125:             * Returns always <code>false</code>.
126:             * @see IStatus#isMultiStatus()
127:             */
128:            public boolean isMultiStatus() {
129:                return false;
130:            }
131:
132:            /*
133:             * @see IStatus#getSeverity()
134:             */
135:            public int getSeverity() {
136:                return fSeverity;
137:            }
138:
139:            /*
140:             * @see IStatus#getPlugin()
141:             */
142:            public String getPlugin() {
143:                return IPDEUIConstants.PLUGIN_ID;
144:            }
145:
146:            /**
147:             * Returns always <code>null</code>.
148:             * @see IStatus#getException()
149:             */
150:            public Throwable getException() {
151:                return null;
152:            }
153:
154:            /**
155:             * Returns always the error severity.
156:             * @see IStatus#getCode()
157:             */
158:            public int getCode() {
159:                return fSeverity;
160:            }
161:
162:            /**
163:             * Returns always <code>null</code>.
164:             * @see IStatus#getChildren()
165:             */
166:            public IStatus[] getChildren() {
167:                return new IStatus[0];
168:            }
169:
170:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.