1 22 package org.netbeans.lib.cvsclient.file; 23 24 28 public class FileStatus { 29 32 public static FileStatus getStatusForString(String statusString) { 33 if (statusString == null) { 34 return null; 35 } 36 37 if (statusString.equals(ADDED.toString())) { 38 return ADDED; 39 } 40 if (statusString.equals(REMOVED.toString())) { 41 return REMOVED; 42 } 43 if (statusString.equals(MODIFIED.toString())) { 44 return MODIFIED; 45 } 46 if (statusString.equals(UP_TO_DATE.toString())) { 47 return UP_TO_DATE; 48 } 49 if (statusString.equals(NEEDS_CHECKOUT.toString())) { 50 return NEEDS_CHECKOUT; 51 } 52 if (statusString.equals(NEEDS_MERGE.toString())) { 53 return NEEDS_MERGE; 54 } 55 if (statusString.equals(NEEDS_PATCH.toString())) { 56 return NEEDS_PATCH; 57 } 58 if (statusString.equals(HAS_CONFLICTS.toString())) { 59 return HAS_CONFLICTS; 60 } 61 if (statusString.equals(UNRESOLVED_CONFLICT.toString())) { 62 return UNRESOLVED_CONFLICT; 63 } 64 if (statusString.equals(UNKNOWN.toString())) { 65 return UNKNOWN; 66 } 67 if (statusString.equals(INVALID.toString())) { 68 return INVALID; 69 } 70 return null; 71 } 72 73 77 public static final FileStatus ADDED = new FileStatus("Locally Added"); 79 83 public static final FileStatus REMOVED = new FileStatus("Locally Removed"); 85 89 public static final FileStatus MODIFIED = new FileStatus("Locally Modified"); 91 94 public static final FileStatus UP_TO_DATE = new FileStatus("Up-to-date"); 96 100 public static final FileStatus NEEDS_CHECKOUT = new FileStatus("Needs Checkout"); 102 106 public static final FileStatus NEEDS_PATCH = new FileStatus("Needs Patch"); 108 112 public static final FileStatus NEEDS_MERGE = new FileStatus("Needs Merge"); 114 118 public static final FileStatus HAS_CONFLICTS = new FileStatus("File had conflicts on merge"); 120 125 public static final FileStatus UNRESOLVED_CONFLICT = new FileStatus("Unresolved Conflict"); 127 130 public static final FileStatus UNKNOWN = new FileStatus("Unknown"); 132 135 public static final FileStatus INVALID = new FileStatus("Entry Invalid"); 137 private final String statusString; 138 139 143 private FileStatus(String statusString) { 144 this.statusString = statusString; 145 } 146 147 150 public String toString() { 151 return statusString; 152 } 153 } | Popular Tags |