KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > lib > cvsclient > command > Watch


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.lib.cvsclient.command;
20
21
22 /**
23  * @author Thomas Singer
24  * @version Dec 2, 2001
25  */

26 public class Watch {
27     public static final Watch EDIT = new Watch("edit", "E", // NOI18N
28
new String JavaDoc[]{"edit"}); // NOI18N
29

30     public static final Watch UNEDIT = new Watch("unedit", "U", // NOI18N
31
new String JavaDoc[]{"unedit"}); // NOI18N
32

33     public static final Watch COMMIT = new Watch("commit", "C", // NOI18N
34
new String JavaDoc[]{"commit"}); // NOI18N
35

36     public static final Watch ALL = new Watch("all", "EUC", // NOI18N
37
new String JavaDoc[]{"edit", "unedit", "commit"}); // NOI18N
38

39     public static final Watch NONE = new Watch("none", "", // NOI18N
40
new String JavaDoc[0]);
41
42     /**
43      * Returns the temporary watch value used in the Notify request.
44      */

45     public static String JavaDoc getWatchString(Watch watch) {
46         if (watch == null) {
47             return NONE.getValue();
48         }
49         return watch.getValue();
50     }
51
52     private final String JavaDoc name;
53     private final String JavaDoc value;
54     private final String JavaDoc[] arguments;
55
56     private Watch(String JavaDoc name, String JavaDoc value, String JavaDoc[] arguments) {
57         this.name = name;
58         this.value = value;
59         this.arguments = arguments;
60     }
61
62     public String JavaDoc[] getArguments() {
63         return arguments;
64     }
65
66     public String JavaDoc toString() {
67         return name;
68     }
69
70     private String JavaDoc getValue() {
71         return value;
72     }
73 }
74
Popular Tags