01: /*
02: * HyperSearchFolderNode - HyperSearch Folder Tree Node
03: * :tabSize=8:indentSize=8:noTabs=false:
04: * :folding=explicit:collapseFolds=1:
05: *
06: * Copyright (C) 2005 Slava Pestov
07: *
08: * This program is free software; you can redistribute it and/or
09: * modify it under the terms of the GNU General Public License
10: * as published by the Free Software Foundation; either version 2
11: * of the License, or any later version.
12: *
13: * This program is distributed in the hope that it will be useful,
14: * but WITHOUT ANY WARRANTY; without even the implied warranty of
15: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16: * GNU General Public License for more details.
17: *
18: * You should have received a copy of the GNU General Public License
19: * along with this program; if not, write to the Free Software
20: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21: */
22: package org.gjt.sp.jedit.search;
23:
24: import java.io.File;
25:
26: public class HyperSearchFolderNode {
27: private File nodeFile;
28: private boolean showFullPath;
29: private static String fileSep = System
30: .getProperty("file.separator");
31: static {
32: if (fileSep.equals("\\"))
33: fileSep = "\\\\";
34: }
35:
36: public File getNodeFile() {
37: return nodeFile;
38: }
39:
40: public HyperSearchFolderNode(File nodeFile, boolean showFullPath) {
41: this .nodeFile = nodeFile;
42: this .showFullPath = showFullPath;
43: }
44:
45: public String toString() {
46: if (showFullPath)
47: return nodeFile.getAbsolutePath();
48: String paths[] = nodeFile.getAbsolutePath().split(fileSep);
49: return paths[paths.length - 1];
50:
51: }
52: }
|