Source Code Cross Referenced for CVSChangeStatus.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.style.TextStyle;
025:
026:        import java.awt.Color;
027:        import java.util.Iterator;
028:
029:        import org.netbeans.lib.cvsclient.command.commit.CommitInformation;
030:
031:        /**
032:         *  Description of the Class
033:         *
034:         *@author     magicthize
035:         *@created    26 May 2002
036:         */
037:        public class CVSChangeStatus implements  Comparable {
038:            private final static java.util.List allTypes = new java.util.ArrayList();
039:
040:            public final static String TAG_CHANGE_STATUS = "tag";
041:            public final static String REMOVE_TAG_CHANGE_STATUS = "removeTag";
042:            public final static String COMMIT_CHANGE_STATUS = "commit";
043:            public final static String UPDATE_CHANGE_STATUS = "update";
044:            public final static String IMPORT_CHANGE_STATUS = "import";
045:
046:            // Tag
047:
048:            public final static CVSChangeStatus CVS_TAG_TAGGED = new CVSChangeStatus(
049:                    TAG_CHANGE_STATUS, 'T', "Tagged", Color.blue.darker(),
050:                    "The file was tagged.", "Tag (file tagged)");
051:
052:            // Remove Tag
053:            public final static CVSChangeStatus CVS_REMOVE_TAG_TAG_REMOVED = new CVSChangeStatus(
054:                    REMOVE_TAG_CHANGE_STATUS, 'D', "Removed", Color.cyan
055:                            .darker(), "The tag was removed from the file.",
056:                    "Remove Tag (tag removed)");
057:
058:            // Commit
059:            public final static CVSChangeStatus CVS_COMMIT_STATUS_ADDED = new CVSChangeStatus(
060:                    COMMIT_CHANGE_STATUS, 'A', CommitInformation.ADDED,
061:                    Color.magenta.darker(),
062:                    "The file was permanently added to the repository.",
063:                    "Commit (file added)");
064:            public final static CVSChangeStatus CVS_COMMIT_STATUS_REMOVED = new CVSChangeStatus(
065:                    COMMIT_CHANGE_STATUS, 'R', CommitInformation.REMOVED,
066:                    Color.cyan.darker(),
067:                    "The file was permanently removed from the repository.",
068:                    "Commit (file removed)");
069:            public final static CVSChangeStatus CVS_COMMIT_STATUS_CHANGED = new CVSChangeStatus(
070:                    COMMIT_CHANGE_STATUS,
071:                    'C',
072:                    CommitInformation.CHANGED,
073:                    Color.green.darker().darker(),
074:                    "Your changes have now been applied to the file in the repository.",
075:                    "Commit (file changed)");
076:            public final static CVSChangeStatus CVS_COMMIT_STATUS_UNKNOWN = new CVSChangeStatus(
077:                    COMMIT_CHANGE_STATUS, 'U', CommitInformation.UNKNOWN,
078:                    Color.yellow.darker(), "The file is unknown.",
079:                    "Commit (file unknown)");
080:            public final static CVSChangeStatus CVS_COMMIT_STATUS_TO_ADD = new CVSChangeStatus(
081:                    COMMIT_CHANGE_STATUS, 'T', CommitInformation.TO_ADD,
082:                    Color.blue, "To add.", "Commit (to be added)");
083:
084:            // Update
085:            public final static CVSChangeStatus CVS_UPDATE_STATUS_UPDATED = new CVSChangeStatus(
086:                    UPDATE_CHANGE_STATUS,
087:                    'U',
088:                    "Updated",
089:                    Color.green.darker(),
090:                    "The file was brought up to date with respect to the repository. "
091:                            + "This is done for any file that exists in the repository but not in your source, "
092:                            + "and for files that you haven't changed but are not the most recent versions available "
093:                            + "in the repository.", "Update (file updated)");
094:            public final static CVSChangeStatus CVS_UPDATE_STATUS_PATCHED = new CVSChangeStatus(
095:                    UPDATE_CHANGE_STATUS,
096:                    'P',
097:                    "Patched",
098:                    Color.green.darker().darker(),
099:                    "The file was brought up to date with respect to the repository. "
100:                            + "This is done for any file that exists in the repository but not in your source, "
101:                            + "and for files that you haven't changed but are not the most recent versions available "
102:                            + "in the repository.", "Update (file patched)");
103:            public final static CVSChangeStatus CVS_UPDATE_STATUS_ADDED = new CVSChangeStatus(
104:                    UPDATE_CHANGE_STATUS,
105:                    'A',
106:                    "Added",
107:                    Color.magenta.darker(),
108:                    "The file has been added to your private copy of the sources, and will be added to "
109:                            + "the source repository when you run commit on the file. This is a reminder to you that "
110:                            + "the file needs to be committed.",
111:                    "Update (file added)");
112:            public final static CVSChangeStatus CVS_UPDATE_STATUS_REMOVED = new CVSChangeStatus(
113:                    UPDATE_CHANGE_STATUS,
114:                    'R',
115:                    "Removed",
116:                    Color.cyan.darker(),
117:                    "The file has been removed from your private copy of the sources, and will be removed "
118:                            + "from the source repository when you run commit on the file. This is a reminder to you "
119:                            + "that the file needs to be committed.",
120:                    "Update (file removed)");
121:            public final static CVSChangeStatus CVS_UPDATE_STATUS_MODIFIED = new CVSChangeStatus(
122:                    UPDATE_CHANGE_STATUS,
123:                    'M',
124:                    "Modified",
125:                    Color.blue.darker(),
126:                    "The file is modified in your working directory.\n\nThis can indicate one of two states for \n"
127:                            + "a file you re working on: either there were no modifications to the same file in the "
128:                            + "repository, so that your file remains as you last saw it, or there were modifications "
129:                            + "in the repository as well as in your copy, but they were merged successfully, "
130:                            + "without conflict, in your working directory.\n\ncvs will print some messages if it merges "
131:                            + "your work, and a backup copy of your working file (as it looked before you ran update) will "
132:                            + "be made. The exact name of that file is printed while update runs.",
133:                    "Update (file modified)");
134:            public final static CVSChangeStatus CVS_UPDATE_STATUS_CONFLICT = new CVSChangeStatus(
135:                    UPDATE_CHANGE_STATUS,
136:                    'C',
137:                    "Conflict",
138:                    Color.red,
139:                    "A conflict was detected while trying to merge your changes to file with changes from "
140:                            + "the source repository. The the copy in your working directory is now the result of "
141:                            + "attempting to merge the two revisions, an unmodified copy of your file is also in your "
142:                            + "working directory, with the name  '.#file.revision' where revision is the revision that "
143:                            + "your modified file started from. Resolve the conflict.",
144:                    "Update (conflict during merge)");
145:            public final static CVSChangeStatus CVS_UPDATE_STATUS_UNKNOWN = new CVSChangeStatus(
146:                    UPDATE_CHANGE_STATUS,
147:                    '?',
148:                    "Unknown",
149:                    Color.yellow.darker(),
150:                    "The file is in your working directory, but does not correspond to anything in the source "
151:                            + "repository, and is not in the list of files for cvs to ignore",
152:                    "Update (unknown status)");
153:
154:            // Import
155:            public final static CVSChangeStatus CVS_IMPORT_STATUS_UPDATED = new CVSChangeStatus(
156:                    IMPORT_CHANGE_STATUS,
157:                    'U',
158:                    "Updated",
159:                    Color.green.darker(),
160:                    "The file already exists in the repository and has not been locally "
161:                            + "modified; a new revision has been created (if necessary).",
162:                    "Import (updated)");
163:            public final static CVSChangeStatus CVS_IMPORT_STATUS_NEW = new CVSChangeStatus(
164:                    IMPORT_CHANGE_STATUS,
165:                    'N',
166:                    "New",
167:                    Color.magenta.darker(),
168:                    "The file is a new file which has been added to the repository.",
169:                    "Import (new file)");
170:            public final static CVSChangeStatus CVS_IMPORT_STATUS_CONFLICT = new CVSChangeStatus(
171:                    IMPORT_CHANGE_STATUS,
172:                    'C',
173:                    "Conflict",
174:                    Color.red,
175:                    "The file already exists in the repository but has been "
176:                            + "locally modified; you will have to merge the changes.",
177:                    "Import (conflicts during merge)");
178:            public final static CVSChangeStatus CVS_IMPORT_STATUS_IGNORED = new CVSChangeStatus(
179:                    IMPORT_CHANGE_STATUS, 'I', "Ignored", Color.black,
180:                    "The file is being ignored.", "Import (file ignored)");
181:            public final static CVSChangeStatus CVS_IMPORT_STATUS_LINK = new CVSChangeStatus(
182:                    IMPORT_CHANGE_STATUS, 'L', "Link", Color.darkGray,
183:                    "The file is a symbolic link.", "Import (file is link)");
184:
185:            private String name;
186:            private String command;
187:            private String description;
188:            private char code;
189:            private TextStyle defaultStyle;
190:
191:            /**
192:             *  Constructor for the CVSSubstType object
193:             *
194:             *@param  name  Description of the Parameter
195:             *@param  icon  Description of the Parameter
196:             */
197:            protected CVSChangeStatus(String command, char code, String name,
198:                    Color defaultColor, String description,
199:                    String shortDescription) {
200:                this .code = code;
201:                this .name = name;
202:                this .command = command;
203:                this .description = description;
204:                defaultStyle = new TextStyle(command + "." + name,
205:                        shortDescription, defaultColor, false, false);
206:                allTypes.add(this );
207:            }
208:
209:            /**
210:             *  Gets the name attribute of the CVSChangeStatus
211:             *
212:             *@return    The name value
213:             */
214:            public String getName() {
215:                return name;
216:            }
217:
218:            /**
219:             *  Gets the command attribute of the CVSChangeStatus object
220:             *
221:             *@return    The command value
222:             */
223:            public String getCommand() {
224:                return command;
225:            }
226:
227:            /**
228:             *  Gets the description attribute of the CVSChangeStatus object
229:             *
230:             *@return    The description value
231:             */
232:            public String getDescription() {
233:                return description;
234:            }
235:
236:            /**
237:             *  Gets the defaultColor attribute of the CVSChangeStatus object
238:             *
239:             *@return    The defaultColor value
240:             */
241:            public TextStyle getDefaultStyle() {
242:                return defaultStyle;
243:            }
244:
245:            public java.util.List getChangeStatusList() {
246:                return allTypes;
247:            }
248:
249:            /**
250:             *  Gets the name attribute of the CVSChangeStatus object
251:             *
252:             *@return    The name value
253:             */
254:            public char getCode() {
255:                return code;
256:            }
257:
258:            /**
259:             *  Description of the Method
260:             *
261:             *@return    Description of the Return Value
262:             */
263:            public String toString() {
264:                return getName();
265:            }
266:
267:            /**
268:             * DOCUMENT ME!
269:             *
270:             * @param code DOCUMENT ME!
271:             *
272:             * @return DOCUMENT ME!
273:             */
274:            public static CVSChangeStatus getStatusForCode(char code,
275:                    String command) {
276:                CVSChangeStatus cs = null;
277:                for (Iterator i = allTypes.iterator(); i.hasNext();) {
278:                    CVSChangeStatus s = (CVSChangeStatus) i.next();
279:                    if (s.getCode() == code && s.command.equals(command)) {
280:                        return s;
281:                    }
282:                }
283:                return null;
284:            }
285:
286:            public static Iterator changeStatus() {
287:                return allTypes.iterator();
288:            }
289:
290:            public static TextStyle getStyleForStatus(GruntspudContext context,
291:                    CVSChangeStatus status) {
292:                return context.getTextStyleModel().getStyle(
293:                        status.getCommand() + "." + status.getName());
294:            }
295:
296:            /**
297:             * DOCUMENT ME!
298:             *
299:             * @param o DOCUMENT ME!
300:             *
301:             * @return DOCUMENT ME!
302:             */
303:            public int compareTo(Object o) {
304:                /** @todo make this better */
305:                return name.compareTo(((CVSChangeStatus) o).getName());
306:            }
307:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.