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