Lines 296-303
Link Here
|
296 |
} |
296 |
} |
297 |
|
297 |
|
298 |
while ( FileUtil.isParentOf( root, parent ) ) { |
298 |
while ( FileUtil.isParentOf( root, parent ) ) { |
299 |
PackageNode n = get( parent ); |
299 |
if (isEmpty(parent)) { |
300 |
if ( n != null && n.isLeaf() ) { |
|
|
301 |
// System.out.println("Cleaning " + parent); |
300 |
// System.out.println("Cleaning " + parent); |
302 |
remove( parent ); |
301 |
remove( parent ); |
303 |
} |
302 |
} |
Lines 354-359
Link Here
|
354 |
} |
353 |
} |
355 |
} |
354 |
} |
356 |
|
355 |
|
|
|
356 |
private boolean isEmpty( FileObject fo) { |
357 |
String path = FileUtil.getRelativePath( root, fo ); |
358 |
assert path != null : "Asking for wrong folder" + fo; |
359 |
Object o = names2nodes.get( path ); |
360 |
if (isNodeCreated(o)) { |
361 |
return ((Node)o).isLeaf(); |
362 |
} |
363 |
return o == NODE_NOT_CREATED_EMPTY; |
364 |
} |
365 |
|
357 |
private PackageNode get( FileObject fo ) { |
366 |
private PackageNode get( FileObject fo ) { |
358 |
String path = FileUtil.getRelativePath( root, fo ); |
367 |
String path = FileUtil.getRelativePath( root, fo ); |
359 |
assert path != null : "Asking for wrong folder" + fo; |
368 |
assert path != null : "Asking for wrong folder" + fo; |
Lines 394-400
Link Here
|
394 |
|
403 |
|
395 |
public void fileChanged( FileEvent fe ) {} |
404 |
public void fileChanged( FileEvent fe ) {} |
396 |
|
405 |
|
397 |
public void fileFolderCreated(final FileEvent fe ) { |
406 |
public void fileFolderCreated(final FileEvent fe ) { |
398 |
FileObject fo = fe.getFile(); |
407 |
FileObject fo = fe.getFile(); |
399 |
if ( FileUtil.isParentOf( root, fo ) && isVisible( root, fo ) ) { |
408 |
if ( FileUtil.isParentOf( root, fo ) && isVisible( root, fo ) ) { |
400 |
if (ProjectManager.mutex().isReadAccess() || ProjectManager.mutex().isWriteAccess()) { |
409 |
if (ProjectManager.mutex().isReadAccess() || ProjectManager.mutex().isWriteAccess()) { |
Lines 405-413
Link Here
|
405 |
}); |
414 |
}); |
406 |
return; |
415 |
return; |
407 |
} |
416 |
} |
408 |
cleanEmptyKeys( fo ); |
417 |
synchronized (names2nodes) { |
|
|
418 |
cleanEmptyKeys( fo ); |
409 |
// add( fo, false); |
419 |
// add( fo, false); |
410 |
findNonExcludedPackages( fo ); |
420 |
findNonExcludedPackages( fo ); |
|
|
421 |
} |
411 |
refreshKeysAsync(); |
422 |
refreshKeysAsync(); |
412 |
} |
423 |
} |
413 |
} |
424 |
} |