mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-01 17:03:12 +07:00
on file statuses changed: do not update structure, only presentations
This commit is contained in:
+16
-4
@@ -134,7 +134,7 @@ class AsyncProjectViewSupport {
|
||||
FileStatusManager.getInstance(project).addFileStatusListener(new FileStatusListener() {
|
||||
@Override
|
||||
public void fileStatusesChanged() {
|
||||
updateAll();
|
||||
updateAllPresentations();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,12 +146,12 @@ class AsyncProjectViewSupport {
|
||||
WolfTheProblemSolver.getInstance(project).addProblemListener(new WolfTheProblemSolver.ProblemListener() {
|
||||
@Override
|
||||
public void problemsAppeared(@NotNull VirtualFile file) {
|
||||
updateByFileToRoot(file);
|
||||
updatePresentationsFromRootTo(file);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void problemsDisappeared(@NotNull VirtualFile file) {
|
||||
updateByFileToRoot(file);
|
||||
updatePresentationsFromRootTo(file);
|
||||
}
|
||||
}, parent);
|
||||
}
|
||||
@@ -221,7 +221,7 @@ class AsyncProjectViewSupport {
|
||||
if (visitor != null) myAsyncTreeModel.accept(visitor, false).done(path -> update(list, structure));
|
||||
}
|
||||
|
||||
private void updateByFileToRoot(@NotNull VirtualFile file) {
|
||||
private void updatePresentationsFromRootTo(@NotNull VirtualFile file) {
|
||||
SmartList<TreePath> list = new SmartList<>();
|
||||
acceptAndUpdate(new ProjectViewFileVisitor(file, null) {
|
||||
@NotNull
|
||||
@@ -234,6 +234,18 @@ class AsyncProjectViewSupport {
|
||||
}, list, false);
|
||||
}
|
||||
|
||||
private void updateAllPresentations() {
|
||||
SmartList<TreePath> list = new SmartList<>();
|
||||
acceptAndUpdate(new TreeVisitor() {
|
||||
@NotNull
|
||||
@Override
|
||||
public Action visit(@NotNull TreePath path) {
|
||||
list.add(path);
|
||||
return Action.CONTINUE;
|
||||
}
|
||||
}, list, false);
|
||||
}
|
||||
|
||||
void accept(List<TreeVisitor> visitors, Consumer<List<TreePath>> consumer) {
|
||||
int size = visitors == null ? 0 : visitors.size();
|
||||
if (visitors != null && !visitors.isEmpty()) {
|
||||
|
||||
Reference in New Issue
Block a user