1 19 package org.netbeans.modules.changelog; 20 21 import java.io.*; 22 import java.text.*; 23 import java.util.*; 24 25 import org.netbeans.modules.vcscore.ui.views.*; 26 import org.openide.nodes.*; 27 28 31 32 public class LogInfoRevision extends FileVcsInfo { 33 34 private static final String NUMBER = "rev-Number"; 35 private static final String DATE = "date"; 36 private static final String AUTHOR = "author"; 37 private static final String STATE = "state"; 38 private static final String LINES = "lines"; 39 private static final String BRANCH = "branch"; 40 private static final String HEADER = "header"; 41 42 public LogInfoRevision(File file) { 43 super(file, "ChangeLogInfo", Children.LEAF); 44 } 45 46 47 public String getNumber() { 48 return getAttributeNonNull(NUMBER); 49 } 50 51 54 public void setNumber(String number) { 55 setAttribute(NUMBER, number); 56 } 57 58 public Date getDate() { 59 return (Date)getAttribute(DATE); 60 } 61 62 63 public void setDate(Date newDate) { 64 setAttribute(DATE, newDate); 65 } 66 67 public String getAuthor() { 68 return getAttributeNonNull(AUTHOR); 69 } 70 71 public void setAuthor(String author) { 72 setAttribute(AUTHOR, author); 73 } 74 75 public String getState() { 76 return getAttributeNonNull(STATE); 77 } 78 79 public void setState(String state) { 80 setAttribute(STATE, state); 81 } 82 83 public String getLines() { 84 return getAttributeNonNull(LINES); 85 } 86 87 public void setLines(String lines) { 88 setAttribute(LINES, lines); 89 } 90 91 94 public int getAddedLines() { 95 String lines = (String )getAttribute(LINES); 96 if (lines != null) { 97 int start = lines.indexOf('+'); 98 int end = lines.indexOf(' '); 99 if (start >= 0 && end > start) { 100 String added = lines.substring(start + 1, end); 101 try { 102 int toReturn = Integer.parseInt(added); 103 return toReturn; 104 } catch (NumberFormatException exc) { 105 } 107 } 108 } 109 return 0; 110 } 111 112 public int getRemovedLines() { 113 String lines = (String )getAttribute(LINES); 114 if (lines != null) { 115 int start = lines.indexOf('-'); 116 if (start >= 0) { 117 String removed = lines.substring(start + 1); 118 try { 119 int toReturn = Integer.parseInt(removed); 120 return toReturn; 121 } catch (NumberFormatException exc) { 122 } 124 } 125 } 126 return 0; 127 128 } 129 130 134 135 public String getBranch() { 136 return getAttributeNonNull(BRANCH); 137 } 138 139 142 143 public void setBranch(String branch) { 144 setAttribute(BRANCH, branch); 145 } 146 147 155 public void setLogInfoHeader(LogInfoHeader header) { 156 setAttribute(HEADER, header); 157 } 158 159 160 public LogInfoHeader getLogInfoHeader() { 161 return (LogInfoHeader)getAttribute(HEADER); 162 } 163 164 165 public static class LogInfoHeader { 166 private File file; 167 private String repositoryFilename; 168 private String headRevision; 169 private String branch; 170 private String accessList; 171 private String keywordSubstitution; 172 private String totalRevisions; 173 private String selectedRevisions; 174 private String description; 175 private String locks; 176 177 public LogInfoHeader() { 178 } 179 180 183 public File getFile() { 184 return file; 185 } 186 187 190 public void setFile(File file) { 191 this.file = file; 192 } 193 194 197 public String getRepositoryFilename() { 198 return repositoryFilename; 199 } 200 201 204 public void setRepositoryFilename(String repositoryFilename) { 205 this.repositoryFilename = repositoryFilename; 206 } 207 208 211 public String getHeadRevision() { 212 return headRevision; 213 } 214 215 218 public void setHeadRevision(String headRevision) { 219 this.headRevision = headRevision; 220 } 221 222 225 public String getBranch() { 226 return branch; 227 } 228 229 232 public void setBranch(String branch) { 233 this.branch = branch; 234 } 235 236 239 public String getAccessList() { 240 return accessList; 241 } 242 243 246 public void setAccessList(String accessList) { 247 this.accessList = accessList; 248 } 249 250 253 public String getKeywordSubstitution() { 254 return keywordSubstitution; 255 } 256 257 260 public void setKeywordSubstitution(String keywordSubstitution) { 261 this.keywordSubstitution = keywordSubstitution; 262 } 263 264 267 public String getTotalRevisions() { 268 return totalRevisions; 269 } 270 271 274 public void setTotalRevisions(String totalRevisions) { 275 this.totalRevisions = totalRevisions; 276 } 277 278 281 public String getSelectedRevisions() { 282 return selectedRevisions; 283 } 284 285 288 public void setSelectedRevisions(String selectedRevisions) { 289 this.selectedRevisions = selectedRevisions; 290 } 291 292 295 public String getDescription() { 296 return description; 297 } 298 299 302 public void setDescription(String description) { 303 this.description = description; 304 } 305 306 309 public String getLocks() { 310 return locks; 311 } 312 313 316 public void setLocks(String locks) { 317 this.locks = locks; 318 } 319 320 } 321 322 323 324 } 325 326 327 328 | Popular Tags |