Source Code Cross Referenced for DirectoryListSet.java in  » Swing-Library » jEdit » org » gjt » sp » jedit » search » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » jEdit » org.gjt.sp.jedit.search 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * DirectoryListSet.java - Directory list matcher
003:         * :tabSize=8:indentSize=8:noTabs=false:
004:         * :folding=explicit:collapseFolds=1:
005:         *
006:         * Copyright (C) 1999, 2000, 2001 Slava Pestov
007:         *
008:         * This program is free software; you can redistribute it and/or
009:         * modify it under the terms of the GNU General Public License
010:         * as published by the Free Software Foundation; either version 2
011:         * of the License, or any later version.
012:         *
013:         * This program is distributed in the hope that it will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016:         * GNU General Public License for more details.
017:         *
018:         * You should have received a copy of the GNU General Public License
019:         * along with this program; if not, write to the Free Software
020:         * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
021:         */
022:
023:        package org.gjt.sp.jedit.search;
024:
025:        //{{{ Imports
026:        import javax.swing.SwingUtilities;
027:        import java.awt.Component;
028:        import java.io.*;
029:        import org.gjt.sp.jedit.io.*;
030:        import org.gjt.sp.jedit.*;
031:        import org.gjt.sp.util.Log;
032:
033:        //}}}
034:
035:        /**
036:         * Recursive directory search.
037:         * @author Slava Pestov
038:         * @version $Id: DirectoryListSet.java 5427 2006-05-27 08:14:07Z kpouer $
039:         */
040:        public class DirectoryListSet extends BufferListSet {
041:            //{{{ DirectoryListSet constructor
042:            public DirectoryListSet(String directory, String glob,
043:                    boolean recurse) {
044:                this .directory = directory;
045:                this .glob = glob;
046:                this .recurse = recurse;
047:                this .skipBinary = jEdit
048:                        .getBooleanProperty("search.skipBinary.toggle");
049:                this .skipHidden = jEdit
050:                        .getBooleanProperty("search.skipHidden.toggle");
051:            } //}}}
052:
053:            //{{{ getDirectory() method
054:            public String getDirectory() {
055:                return directory;
056:            } //}}}
057:
058:            //{{{ setDirectory() method
059:            /**
060:             * @since jEdit 4.2pre1
061:             */
062:            public void setDirectory(String directory) {
063:                this .directory = directory;
064:                invalidateCachedList();
065:            } //}}}
066:
067:            //{{{ getFileFilter() method
068:            public String getFileFilter() {
069:                return glob;
070:            } //}}}
071:
072:            //{{{ setFileFilter() method
073:            /**
074:             * @since jEdit 4.2pre1
075:             */
076:            public void setFileFilter(String glob) {
077:                this .glob = glob;
078:                invalidateCachedList();
079:            } //}}}
080:
081:            //{{{ isRecursive() method
082:            public boolean isRecursive() {
083:                return recurse;
084:            } //}}}
085:
086:            //{{{ setRecursive() method
087:            /**
088:             * @since jEdit 4.2pre1
089:             */
090:            public void setRecursive(boolean recurse) {
091:                this .recurse = recurse;
092:                invalidateCachedList();
093:            } //}}}
094:
095:            //{{{ getCode() method
096:            public String getCode() {
097:                return "new DirectoryListSet(\""
098:                        + MiscUtilities.charsToEscapes(directory) + "\",\""
099:                        + MiscUtilities.charsToEscapes(glob) + "\"," + recurse
100:                        + ")";
101:            } //}}}
102:
103:            //{{{ _getFiles() method
104:            protected String[] _getFiles(final Component comp) {
105:                this .skipBinary = jEdit
106:                        .getBooleanProperty("search.skipBinary.toggle");
107:                this .skipHidden = jEdit
108:                        .getBooleanProperty("search.skipHidden.toggle");
109:                final VFS vfs = VFSManager.getVFSForPath(directory);
110:                Object session;
111:                if (SwingUtilities.isEventDispatchThread()) {
112:                    session = vfs.createVFSSession(directory, comp);
113:                } else {
114:                    final Object[] returnValue = new Object[1];
115:
116:                    try {
117:                        SwingUtilities.invokeAndWait(new Runnable() {
118:                            public void run() {
119:                                returnValue[0] = vfs.createVFSSession(
120:                                        directory, comp);
121:                            }
122:                        });
123:                    } catch (Exception e) {
124:                        Log.log(Log.ERROR, this , e);
125:                    }
126:
127:                    session = returnValue[0];
128:                }
129:
130:                if (session == null)
131:                    return null;
132:
133:                try {
134:                    return vfs._listDirectory(session, directory, glob,
135:                            recurse, comp, skipBinary, skipHidden);
136:                } catch (IOException io) {
137:                    VFSManager.error(comp, directory, "ioerror",
138:                            new String[] { io.toString() });
139:                    return null;
140:                }
141:            } //}}}
142:
143:            //{{{ Private members
144:            private String directory;
145:            private String glob;
146:            private boolean recurse;
147:            private boolean skipHidden;
148:            private boolean skipBinary;
149:            //}}}
150:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.