1 19 20 package org.netbeans.modules.versioning.system.cvss; 21 22 import org.openide.filesystems.FileObject; 23 import org.openide.filesystems.FileUtil; 24 import org.openide.util.lookup.InstanceContent; 25 26 import java.io.File ; 27 import java.util.List ; 28 import java.util.ArrayList ; 29 30 35 public class CvsFileNode { 36 37 private final File file; 38 39 public CvsFileNode(File file) { 40 this.file = file; 41 } 42 43 public String getName() { 44 return file.getName(); 45 } 46 47 48 public FileInformation getInformation() { 49 return CvsVersioningSystem.getInstance().getStatusCache().getStatus(file); 50 } 51 52 public File getFile() { 53 return file; 54 } 55 56 public boolean equals(Object o) { 57 if (this == o) return true; 58 return o instanceof CvsFileNode && file.equals(((CvsFileNode) o).file); 59 } 60 61 public int hashCode() { 62 return file.hashCode(); 63 } 64 65 public FileObject getFileObject() { 66 return FileUtil.toFileObject(file); 67 } 68 69 public Object [] getLookupObjects() { 70 List list = new ArrayList (2); 71 list.add(this); 72 FileObject fo = getFileObject(); 73 if (fo != null) { 74 list.add(fo); 75 } 76 return list.toArray(new Object [list.size()]); 77 } 78 79 80 } 81 | Popular Tags |