Lines 51-56
Link Here
|
51 |
import javax.swing.JComponent; |
51 |
import javax.swing.JComponent; |
52 |
import javax.swing.event.ChangeEvent; |
52 |
import javax.swing.event.ChangeEvent; |
53 |
import javax.swing.event.ChangeListener; |
53 |
import javax.swing.event.ChangeListener; |
|
|
54 |
import org.netbeans.api.queries.VisibilityQuery; |
54 |
import org.netbeans.spi.project.support.ant.PathMatcher; |
55 |
import org.netbeans.spi.project.support.ant.PathMatcher; |
55 |
import org.openide.util.NbPreferences; |
56 |
import org.openide.util.NbPreferences; |
56 |
import org.openide.util.Parameters; |
57 |
import org.openide.util.Parameters; |
Lines 229-247
Link Here
|
229 |
|
230 |
|
230 |
private int scanCounter; |
231 |
private int scanCounter; |
231 |
private static final int GRANULARITY = 1000; |
232 |
private static final int GRANULARITY = 1000; |
232 |
private void scan(File d, String prefix, PathMatcher matcher, Pattern ignoredFiles) { |
233 |
private void scan(File d, String prefix, PathMatcher matcher) { |
233 |
String[] children = d.list(); |
234 |
String[] children = d.list(); |
234 |
if (children == null) { |
235 |
if (children == null) { |
235 |
return; |
236 |
return; |
236 |
} |
237 |
} |
237 |
for (String child : children) { |
238 |
for (String child : children) { |
238 |
if (ignoredFiles.matcher(child).find()) { |
239 |
File f = new File(d, child); |
|
|
240 |
if (!VisibilityQuery.getDefault().isVisible(f)) { |
239 |
continue; |
241 |
continue; |
240 |
} |
242 |
} |
241 |
File f = new File(d, child); |
|
|
242 |
boolean dir = f.isDirectory(); |
243 |
boolean dir = f.isDirectory(); |
243 |
if (dir) { |
244 |
if (dir) { |
244 |
scan(f, prefix + child + "/", matcher, ignoredFiles); // NOI18N |
245 |
scan(f, prefix + child + "/", matcher); // NOI18N |
245 |
} else { |
246 |
} else { |
246 |
synchronized (this) { |
247 |
synchronized (this) { |
247 |
if (interrupted) { |
248 |
if (interrupted) { |
Lines 262-271
Link Here
|
262 |
|
263 |
|
263 |
private final class RecalculateTask implements Runnable { |
264 |
private final class RecalculateTask implements Runnable { |
264 |
|
265 |
|
265 |
// XXX #95974: VisibilityQuery only works on FileObject, and that would be too slow |
|
|
266 |
// copied from: org.netbeans.modules.masterfs.GlobalVisibilityQueryImpl |
267 |
final Pattern ignoredFiles = Pattern.compile(NbPreferences.root().node("/org/netbeans/core"). // NOI18N |
268 |
get("IgnoredFiles", "^(CVS|SCCS|vssver.?\\.scc|#.*#|%.*%|\\.(cvsignore|svn|DS_Store)|_svn)$|~$|^\\..*$")); // NOI18N |
269 |
|
266 |
|
270 |
public void run() { |
267 |
public void run() { |
271 |
File[] _roots; |
268 |
File[] _roots; |
Lines 282-288
Link Here
|
282 |
} |
279 |
} |
283 |
PathMatcher matcher = new PathMatcher(_includes, _excludes, null); |
280 |
PathMatcher matcher = new PathMatcher(_includes, _excludes, null); |
284 |
for (File root : _roots) { |
281 |
for (File root : _roots) { |
285 |
scan(root, "", matcher, ignoredFiles); |
282 |
scan(root, "", matcher); |
286 |
} |
283 |
} |
287 |
synchronized (IncludeExcludeVisualizer.this) { |
284 |
synchronized (IncludeExcludeVisualizer.this) { |
288 |
busy = false; |
285 |
busy = false; |