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


001:        /*******************************************************************************
002:         * Copyright (c) 2003, 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.navigator;
011:
012:        /**
013:         * <p>
014:         * Enumeration of the Priority values supported by the Common Navigator.
015:         * </p>
016:         *  
017:         * @since 3.2
018:         */
019:        public final class Priority {
020:
021:            /**
022:             * Indicates Highest priority as an int.
023:             */
024:            public static final int HIGHEST_PRIORITY_VALUE = 0;
025:
026:            /**
027:             * Indicates Higher priority as an int.
028:             */
029:            public static final int HIGHER_PRIORITY_VALUE = 1;
030:
031:            /**
032:             * Indicates High priority as an int.
033:             */
034:            public static final int HIGH_PRIORITY_VALUE = 2;
035:
036:            /**
037:             * Indicates Normal priority as an int.
038:             */
039:            public static final int NORMAL_PRIORITY_VALUE = 3;
040:
041:            /**
042:             * Indicates Low priority as an int.
043:             */
044:            public static final int LOW_PRIORITY_VALUE = 4;
045:
046:            /**
047:             * Indicates Lower priority as an int.
048:             */
049:            public static final int LOWER_PRIORITY_VALUE = 5;
050:
051:            /**
052:             * Indicates Lowest priority as an int.
053:             */
054:            public static final int LOWEST_PRIORITY_VALUE = 6;
055:
056:            /**
057:             * Indicates Highest priority as a String.
058:             */
059:            public static final String HIGHEST_PRIORITY_LITERAL = "highest"; //$NON-NLS-1$
060:
061:            /**
062:             * Indicates Higher priority as a String.
063:             */
064:            public static final String HIGHER_PRIORITY_LITERAL = "higher"; //$NON-NLS-1$
065:
066:            /**
067:             * Indicates High priority as a String.
068:             */
069:            public static final String HIGH_PRIORITY_LITERAL = "high"; //$NON-NLS-1$
070:
071:            /**
072:             * Indicates Normal priority as a String.
073:             */
074:            public static final String NORMAL_PRIORITY_LITERAL = "normal"; //$NON-NLS-1$
075:
076:            /**
077:             * Indicates Low priority as a String.
078:             */
079:            public static final String LOW_PRIORITY_LITERAL = "low"; //$NON-NLS-1$
080:
081:            /**
082:             * Indicates Lower priority as a String.
083:             */
084:            public static final String LOWER_PRIORITY_LITERAL = "lower"; //$NON-NLS-1$
085:
086:            /**
087:             * Indicates Lowest priority as a String.
088:             */
089:            public static final String LOWEST_PRIORITY_LITERAL = "lowest"; //$NON-NLS-1$
090:
091:            /**
092:             * Indicates Highest priority as a Priority enumeration.
093:             */
094:            public static final Priority HIGHEST = new Priority(
095:                    HIGHEST_PRIORITY_VALUE, HIGHEST_PRIORITY_LITERAL);
096:
097:            /**
098:             * Indicates Higher priority as a Priority enumeration.
099:             */
100:            public static final Priority HIGHER = new Priority(
101:                    HIGHER_PRIORITY_VALUE, HIGHER_PRIORITY_LITERAL);
102:
103:            /**
104:             * Indicates High priority as a Priority enumeration.
105:             */
106:            public static final Priority HIGH = new Priority(
107:                    HIGH_PRIORITY_VALUE, HIGH_PRIORITY_LITERAL);
108:
109:            /**
110:             * Indicates Normal priority as a Priority enumeration.
111:             */
112:            public static final Priority NORMAL = new Priority(
113:                    NORMAL_PRIORITY_VALUE, NORMAL_PRIORITY_LITERAL);
114:
115:            /**
116:             * Indicates Low priority as a Priority enumeration.
117:             */
118:            public static final Priority LOW = new Priority(LOW_PRIORITY_VALUE,
119:                    LOW_PRIORITY_LITERAL);
120:
121:            /**
122:             * Indicates Lower priority as a Priority enumeration.
123:             */
124:            public static final Priority LOWER = new Priority(
125:                    LOWER_PRIORITY_VALUE, LOWER_PRIORITY_LITERAL);
126:
127:            /**
128:             * Indicates Lowest priority as a Priority enumeration.
129:             */
130:            public static final Priority LOWEST = new Priority(
131:                    LOWEST_PRIORITY_VALUE, LOWEST_PRIORITY_LITERAL);
132:
133:            /**
134:             * The ordered array of possible enumeration values (0=> Highest,
135:             * length-1=>Lowest)
136:             */
137:            public static final Priority[] ENUM_ARRAY = new Priority[] {
138:                    HIGHEST, HIGHER, HIGH, NORMAL, LOW, LOWER, LOWEST };
139:
140:            /**
141:             * 
142:             * Returns the correct instance of the Priority ENUM for aLiteral.
143:             * 
144:             * <p>
145:             * This method will return NORMAL if the supplied value of aLiteral is
146:             * invalid.
147:             * </p>
148:             * 
149:             * @param aLiteral
150:             *            One of the defined *_LITERAL constants of this class
151:             * @return The corresponding Priority Enum or NORMAL if aLiteral is invalid
152:             */
153:            public static Priority get(String aLiteral) {
154:                for (int i = 0; i < ENUM_ARRAY.length; i++) {
155:                    if (ENUM_ARRAY[i].getLiteral().equals(aLiteral)) {
156:                        return ENUM_ARRAY[i];
157:                    }
158:                }
159:                return NORMAL;
160:            }
161:
162:            /**
163:             * 
164:             * Returns the correct instance of the Priority ENUM for aValue.
165:             * 
166:             * <p>
167:             * This method will return NORMAL if the supplied value of aValue is
168:             * invalid.
169:             * </p>
170:             * 
171:             * @param aValue
172:             *            One of the defined *_VALUE constants of this class
173:             * @return The corresponding Priority Enum or NORMAL if aValue is invalid
174:             */
175:            public static Priority get(int aValue) {
176:
177:                switch (aValue) {
178:                case HIGHEST_PRIORITY_VALUE:
179:                    return HIGHEST;
180:                case HIGHER_PRIORITY_VALUE:
181:                    return HIGHER;
182:                case HIGH_PRIORITY_VALUE:
183:                    return HIGH;
184:                case LOWER_PRIORITY_VALUE:
185:                    return LOWER;
186:                case LOWEST_PRIORITY_VALUE:
187:                    return LOWEST;
188:                case NORMAL_PRIORITY_VALUE:
189:                default:
190:                    return NORMAL;
191:                }
192:            }
193:
194:            private final int value;
195:
196:            private final String literal;
197:
198:            protected Priority(int aValue, String aLiteral) {
199:                value = aValue;
200:                literal = aLiteral;
201:            }
202:
203:            /**
204:             * 
205:             * @return The literal string for this specific Priority.
206:             */
207:            public String getLiteral() {
208:                return literal;
209:            }
210:
211:            /**
212:             * 0 is the lowest priority; 7 is the highest.
213:             * 
214:             * @return The integer value for this specific Priority. 
215:             */
216:            public int getValue() {
217:                return value;
218:            }
219:
220:            /* (non-Javadoc)
221:             * @see java.lang.Object#toString()
222:             */
223:            public String toString() {
224:                return "Priority [" + getLiteral() + "]"; //$NON-NLS-1$//$NON-NLS-2$
225:            }
226:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.