Source Code Cross Referenced for CVSSubstType.java in  » Source-Control » gruntspud » gruntspud » 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 » Source Control » gruntspud » gruntspud 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Gruntspud
003:         *
004:         *  Copyright (C) 2002 Brett Smith.
005:         *
006:         *  Written by: Brett Smith <t_magicthize@users.sourceforge.net>
007:         *
008:         *  This program is free software; you can redistribute it and/or
009:         *  modify it under the terms of the GNU Library General Public License
010:         *  as published by the Free Software Foundation; either version 2 of
011:         *  the License, or (at your option) any later version.
012:         *  This program is distributed in the hope that it will be useful,
013:         *  but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
015:         *  GNU Library General Public License for more details.
016:         *
017:         *  You should have received a copy of the GNU Library General Public
018:         *  License along with this program; if not, write to the Free Software
019:         *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
020:         */
021:
022:        package gruntspud;
023:
024:        import gruntspud.ui.UIUtil;
025:
026:        import java.util.HashMap;
027:        import java.util.Iterator;
028:
029:        import javax.swing.Icon;
030:
031:        import org.netbeans.lib.cvsclient.command.KeywordSubstitutionOptions;
032:
033:        /**
034:         *  Description of the Class
035:         *
036:         *@author     magicthize
037:         *@created    26 May 2002
038:         */
039:        public class CVSSubstType implements  Comparable {
040:            public final static HashMap ALL_TYPES = new HashMap();
041:
042:            /**
043:             *  Description of the Field
044:             */
045:            public final static CVSSubstType CVS_SUBST_TYPE_DEFAULT_LOCKER = new CVSSubstType(
046:                    "Default Locker", UIUtil
047:                            .getCachedIcon(Constants.ICON_TYPE_DEFAULT_LOCKER),
048:                    KeywordSubstitutionOptions.DEFAULT_LOCKER);
049:
050:            /**
051:             *  Description of the Field
052:             */
053:            public final static CVSSubstType CVS_SUBST_TYPE_OLD_VALUES = new CVSSubstType(
054:                    "Old values", UIUtil
055:                            .getCachedIcon(Constants.ICON_TYPE_OLD_VALUES),
056:                    KeywordSubstitutionOptions.OLD_VALUES);
057:
058:            /**
059:             *  Description of the Field
060:             */
061:            public final static CVSSubstType CVS_SUBST_TYPE_ONLY_KEYWORDS = new CVSSubstType(
062:                    "Only keywords", UIUtil
063:                            .getCachedIcon(Constants.ICON_TYPE_ONLY_KEYWORDS),
064:                    KeywordSubstitutionOptions.ONLY_KEYWORDS);
065:
066:            /**
067:             *  Description of the Field
068:             */
069:            public final static CVSSubstType CVS_SUBST_TYPE_ONLY_VALUES = new CVSSubstType(
070:                    "Only values", UIUtil
071:                            .getCachedIcon(Constants.ICON_TYPE_ONLY_VALUES),
072:                    KeywordSubstitutionOptions.ONLY_VALUES);
073:
074:            /**
075:             *  Description of the Field
076:             */
077:            public final static CVSSubstType CVS_SUBST_TYPE_TEXT = new CVSSubstType(
078:                    "Text", UIUtil.getCachedIcon(Constants.ICON_TYPE_TEXT),
079:                    KeywordSubstitutionOptions.DEFAULT);
080:
081:            /**
082:             *  Description of the Field
083:             */
084:            public final static CVSSubstType CVS_SUBST_TYPE_BINARY = new CVSSubstType(
085:                    "Binary", UIUtil.getCachedIcon(Constants.ICON_TYPE_BINARY),
086:                    KeywordSubstitutionOptions.BINARY);
087:
088:            /**
089:             *  Description of the Field
090:             */
091:            public final static CVSSubstType CVS_SUBST_TYPE_UNICODE = new CVSSubstType(
092:                    "Unicode", UIUtil
093:                            .getCachedIcon(Constants.ICON_TYPE_UNICODE), null);
094:
095:            /**
096:             *  Description of the Field
097:             */
098:            public final static CVSSubstType CVS_SUBST_TYPE_IGNORED = new CVSSubstType(
099:                    "Ignored",
100:                    UIUtil.getCachedIcon(Constants.ICON_TYPE_IGNORE), null);
101:
102:            /**
103:             *  Description of the Field
104:             */
105:            public final static CVSSubstType CVS_SUBST_TYPE_COPY = new CVSSubstType(
106:                    "Copy", UIUtil.getCachedIcon(Constants.ICON_TYPE_COPY),
107:                    null);
108:
109:            /**
110:             *  Description of the Field
111:             */
112:            public final static CVSSubstType CVS_SUBST_TYPE_DIRECTORY = new CVSSubstType(
113:                    "Directory", UIUtil
114:                            .getCachedIcon(Constants.ICON_TYPE_DIRECTORY), null);
115:            private String name;
116:            private Icon icon;
117:            private KeywordSubstitutionOptions keywordSubstitutionOptions;
118:
119:            /**
120:             *  Constructor for the CVSSubstType object
121:             *
122:             *@param  name  Description of the Parameter
123:             *@param  icon  Description of the Parameter
124:             */
125:            private CVSSubstType(String name, Icon icon,
126:                    KeywordSubstitutionOptions keywordSubstitutionOptions) {
127:                this .name = name;
128:                this .icon = icon;
129:                this .keywordSubstitutionOptions = keywordSubstitutionOptions;
130:
131:                if (keywordSubstitutionOptions != null) {
132:                    ALL_TYPES.put(keywordSubstitutionOptions, this );
133:                }
134:            }
135:
136:            /**
137:             *  Gets the name attribute of the CVSFileType object
138:             *
139:             *@return    The name value
140:             */
141:            public String getName() {
142:                return name;
143:            }
144:
145:            /**
146:             *  Gets the name attribute of the CVSFileType object
147:             *
148:             *@return    The name value
149:             */
150:            public KeywordSubstitutionOptions getKeywordSubstitutionOptions() {
151:                return keywordSubstitutionOptions;
152:            }
153:
154:            /**
155:             *  Gets the icon attribute of the CVSFileType object
156:             *
157:             *@return    The icon value
158:             */
159:            public Icon getIcon() {
160:                return icon;
161:            }
162:
163:            /**
164:             *  Description of the Method
165:             *
166:             *@return    Description of the Return Value
167:             */
168:            public String toString() {
169:                return getName();
170:            }
171:
172:            /**
173:             * DOCUMENT ME!
174:             *
175:             * @param s DOCUMENT ME!
176:             *
177:             * @return DOCUMENT ME!
178:             */
179:            public static CVSSubstType getSubstTypeForName(String s) {
180:                /** @todo was a bad move making ignored a substitution type - change it */
181:                if (s.equals(CVSSubstType.CVS_SUBST_TYPE_IGNORED.getName())) {
182:                    return CVSSubstType.CVS_SUBST_TYPE_IGNORED;
183:                }
184:
185:                for (Iterator i = ALL_TYPES.values().iterator(); i.hasNext();) {
186:                    CVSSubstType c = (CVSSubstType) i.next();
187:
188:                    if (c.getName().equals(s)) {
189:                        return c;
190:                    }
191:                }
192:
193:                return null;
194:            }
195:
196:            /**
197:             * DOCUMENT ME!
198:             *
199:             * @param s DOCUMENT ME!
200:             *
201:             * @return DOCUMENT ME!
202:             */
203:            public static CVSSubstType getSubstTypeForString(String s) {
204:                KeywordSubstitutionOptions k = KeywordSubstitutionOptions
205:                        .findKeywordSubstOption(s.substring(2));
206:
207:                return (CVSSubstType) ALL_TYPES.get(k);
208:            }
209:
210:            /**
211:             * DOCUMENT ME!
212:             *
213:             * @param o DOCUMENT ME!
214:             *
215:             * @return DOCUMENT ME!
216:             */
217:            public int compareTo(Object o) {
218:                /** @todo make this better */
219:                return name.compareTo(((CVSSubstType) o).getName());
220:            }
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.