use of com.intellij.openapi.externalSystem.view.ExternalProjectsView in project intellij-community by JetBrains.
the class ExternalSystemNotificationManager method showNotification.
public void showNotification(@NotNull final ProjectSystemId externalSystemId, @NotNull final NotificationData notificationData) {
myUpdater.submit(() -> {
if (myProject.isDisposed())
return;
final Application app = ApplicationManager.getApplication();
Runnable action = () -> {
if (!initializedExternalSystem.contains(externalSystemId)) {
app.runWriteAction(() -> {
if (myProject.isDisposed())
return;
ExternalSystemUtil.ensureToolWindowContentInitialized(myProject, externalSystemId);
initializedExternalSystem.add(externalSystemId);
});
}
if (myProject.isDisposed())
return;
NotificationGroup group;
if (notificationData.getBalloonGroup() == null) {
ExternalProjectsView externalProjectsView = ExternalProjectsManager.getInstance(myProject).getExternalProjectsView(externalSystemId);
group = externalProjectsView instanceof ExternalProjectsViewImpl ? ((ExternalProjectsViewImpl) externalProjectsView).getNotificationGroup() : null;
} else {
final NotificationGroup registeredGroup = NotificationGroup.findRegisteredGroup(notificationData.getBalloonGroup());
group = registeredGroup != null ? registeredGroup : NotificationGroup.balloonGroup(notificationData.getBalloonGroup());
}
if (group == null)
return;
final Notification notification = group.createNotification(notificationData.getTitle(), notificationData.getMessage(), notificationData.getNotificationCategory().getNotificationType(), notificationData.getListener());
myNotifications.add(notification);
if (notificationData.isBalloonNotification()) {
applyNotification(notification);
} else {
addMessage(notification, externalSystemId, notificationData);
}
};
app.invokeLater(action, ModalityState.defaultModalityState(), myProject.getDisposed());
});
}
use of com.intellij.openapi.externalSystem.view.ExternalProjectsView in project intellij-community by JetBrains.
the class ExternalProjectsManager method getState.
@NotNull
@Override
public ExternalProjectsState getState() {
ApplicationManager.getApplication().assertIsDispatchThread();
for (ExternalProjectsView externalProjectsView : myProjectsViews) {
if (externalProjectsView instanceof ExternalProjectsViewImpl) {
final ExternalProjectsViewState externalProjectsViewState = ((ExternalProjectsViewImpl) externalProjectsView).getState();
final ExternalProjectsState.State state = myState.getExternalSystemsState().get(externalProjectsView.getSystemId().getId());
assert state != null;
state.setProjectsViewState(externalProjectsViewState);
}
}
return myState;
}
Aggregations