1 22 package org.gjt.sp.jedit.search; 23 24 import java.io.File ; 25 26 public class HyperSearchFolderNode 27 { 28 private File nodeFile; 29 private boolean showFullPath; 30 private static String fileSep = System.getProperty("file.separator"); 31 static 32 { 33 if (fileSep.equals("\\")) 34 fileSep = "\\\\"; 35 } 36 37 public File getNodeFile() { 38 return nodeFile; 39 } 40 41 public HyperSearchFolderNode(File nodeFile, boolean showFullPath) { 42 this.nodeFile = nodeFile; 43 this.showFullPath = showFullPath; 44 } 45 46 public String toString() { 47 if (showFullPath) 48 return nodeFile.getAbsolutePath(); 49 String paths[] = nodeFile.getAbsolutePath().split(fileSep); 50 return paths[paths.length - 1]; 51 52 } 53 } 54 | Popular Tags |