mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 20:39:40 +07:00
[services] IDEA-326824 do not show tool window on handling an event from not initialized contributor
GitOrigin-RevId: 7be3654a141cea6c6c1d5e8498a1d87317b8d9b5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7f880090d2
commit
437dc8d097
@@ -764,6 +764,7 @@ public final class RunDashboardManagerImpl implements RunDashboardManager, Persi
|
||||
loadHiddenConfigurations();
|
||||
syncConfigurations();
|
||||
initServiceContentListeners();
|
||||
updateDashboard(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -105,8 +105,14 @@ public final class ServiceViewManagerImpl implements ServiceViewManager, Persist
|
||||
}
|
||||
|
||||
ServiceViewItem eventRoot = ContainerUtil.find(myModel.getRoots(), root -> e.contributorClass.isInstance(root.getRootContributor()));
|
||||
ServiceViewContributor<?> notInitializedContributor = findNotIntializedContributor(e.contributorClass, eventRoot);
|
||||
boolean initialized = notInitializedContributor == null;
|
||||
if (!initialized &&
|
||||
(e.type == ServiceEventListener.EventType.RESET || e.type == ServiceEventListener.EventType.UNLOAD_SYNC_RESET)) {
|
||||
myNotInitializedContributors.remove(notInitializedContributor);
|
||||
}
|
||||
if (eventRoot != null) {
|
||||
boolean show = !(eventRoot.getViewDescriptor() instanceof ServiceViewNonActivatingDescriptor);
|
||||
boolean show = !(eventRoot.getViewDescriptor() instanceof ServiceViewNonActivatingDescriptor) && initialized;
|
||||
updateToolWindow(toolWindowId, true, show);
|
||||
}
|
||||
else {
|
||||
@@ -116,6 +122,18 @@ public final class ServiceViewManagerImpl implements ServiceViewManager, Persist
|
||||
}
|
||||
}
|
||||
|
||||
private @Nullable ServiceViewContributor<?> findNotIntializedContributor(Class<?> contributorClass, ServiceViewItem eventRoot) {
|
||||
if (eventRoot != null) {
|
||||
return myNotInitializedContributors.contains(eventRoot.getRootContributor()) ? eventRoot.getRootContributor() : null;
|
||||
}
|
||||
for (ServiceViewContributor<?> contributor : myNotInitializedContributors) {
|
||||
if (contributorClass.isInstance(contributor)) {
|
||||
return contributor;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private Set<? extends ServiceViewContributor<?>> getActiveContributors() {
|
||||
return ContainerUtil.map2Set(myModel.getRoots(), ServiceViewItem::getRootContributor);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user