mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
project structure daemon analyzer: improved rechecking after adding a new module
This commit is contained in:
@@ -108,11 +108,6 @@ public class ProjectConfigurable extends ProjectStructureElementConfigurable<Pro
|
||||
updateCircularDependencyWarning();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allProblemsChanged() {
|
||||
updateCircularDependencyWarning();
|
||||
}
|
||||
});
|
||||
init(model);
|
||||
}
|
||||
|
||||
-6
@@ -76,12 +76,6 @@ public class ArtifactsStructureConfigurableContextImpl implements ArtifactsStruc
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void allProblemsChanged() {
|
||||
for (Map.Entry<Artifact, ArtifactEditorImpl> entry : myArtifactEditors.entrySet()) {
|
||||
updateProblems(entry.getKey(), entry.getValue());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
-4
@@ -90,10 +90,6 @@ public abstract class BaseStructureConfigurable extends MasterDetailsComponent i
|
||||
updateTree();
|
||||
}
|
||||
|
||||
public void allProblemsChanged() {
|
||||
updateTree();
|
||||
}
|
||||
|
||||
private void updateTree() {
|
||||
if (!myTree.isShowing()) return;
|
||||
|
||||
|
||||
+1
-1
@@ -529,7 +529,7 @@ public class ModuleStructureConfigurable extends BaseStructureConfigurable imple
|
||||
selectNodeInTree(node);
|
||||
final ProjectStructureDaemonAnalyzer daemonAnalyzer = myContext.getDaemonAnalyzer();
|
||||
daemonAnalyzer.queueUpdate(new ModuleProjectStructureElement(myContext, module));
|
||||
daemonAnalyzer.clearAllProblems(); //missing modules added
|
||||
daemonAnalyzer.queueUpdateForAllElementsWithErrors(); //missing modules added
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
-5
@@ -47,11 +47,6 @@ public class ProjectConfigurationProblems {
|
||||
public void problemsChanged(@NotNull ProjectStructureElement element) {
|
||||
updateErrors(element);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void allProblemsChanged() {
|
||||
clearProblems();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -179,9 +179,18 @@ public class ProjectStructureDaemonAnalyzer implements Disposable {
|
||||
myProblemHolders.clear();
|
||||
}
|
||||
|
||||
public void clearAllProblems() {
|
||||
public void queueUpdateForAllElementsWithErrors() {
|
||||
List<ProjectStructureElement> toUpdate = new ArrayList<ProjectStructureElement>();
|
||||
for (Map.Entry<ProjectStructureElement, ProjectStructureProblemsHolderImpl> entry : myProblemHolders.entrySet()) {
|
||||
if (entry.getValue().containProblems()) {
|
||||
toUpdate.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
myProblemHolders.clear();
|
||||
myDispatcher.getMulticaster().allProblemsChanged();
|
||||
LOG.debug("Adding to queue updates for " + toUpdate.size() + " problematic elements");
|
||||
for (ProjectStructureElement element : toUpdate) {
|
||||
queueUpdate(element);
|
||||
}
|
||||
}
|
||||
|
||||
public void dispose() {
|
||||
|
||||
-2
@@ -27,6 +27,4 @@ public interface ProjectStructureDaemonAnalyzerListener extends EventListener {
|
||||
void usagesCollected(@NotNull ProjectStructureElement containingElement);
|
||||
|
||||
void problemsChanged(@NotNull ProjectStructureElement element);
|
||||
|
||||
void allProblemsChanged();
|
||||
}
|
||||
|
||||
+4
@@ -66,6 +66,10 @@ public class ProjectStructureProblemsHolderImpl implements ProjectStructureProbl
|
||||
}
|
||||
}
|
||||
|
||||
public boolean containProblems() {
|
||||
return myProblemDescriptions != null && !myProblemDescriptions.isEmpty();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public List<ProjectStructureProblemDescription> getProblemDescriptions() {
|
||||
return myProblemDescriptions;
|
||||
|
||||
Reference in New Issue
Block a user