com.intellij.notification.NotificationListener Java Examples

The following examples show how to use com.intellij.notification.NotificationListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: UploadNotification.java    From markdown-image-kit with MIT License 7 votes vote down vote up
/**
 * 上传时检查到配置错误时通知
 *
 * @param project    the project
 * @param actionName the action name
 */
public static void notifyConfigurableError(Project project, String actionName) {
    String content = "<p><a href=''>Configure " + actionName + " OSS</a></p><br />";
    content = "<p>You may need to set or reset your account. Please be sure to <b>test</b> it after the setup is complete.</p>" + content + "<br />";
    content = content + "<p>Or you may need <a href='" + HELP_URL + "'>Help</a></p>";
    Notifications.Bus.notify(new Notification(MIK_NOTIFICATION_GROUP,
                                              "Configurable Error",
                                              content,
                                              NotificationType.ERROR,
                                              new NotificationListener.Adapter() {
                                                  @Override
                                                  protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
                                                      String url = e.getDescription();
                                                      log.trace("{}", e.getDescription());
                                                      if (StringUtils.isBlank(url)) {
                                                          ProjectSettingsPage configurable = new ProjectSettingsPage();
                                                          // 打开设置面板
                                                          ShowSettingsUtil.getInstance().editConfigurable(project, configurable);
                                                      } else {
                                                          BrowserUtil.browse(url);
                                                      }
                                                      hideBalloon(notification.getBalloon());
                                                  }
                                              }), project);
}
 
Example #2
Source File: BuckPluginNotifications.java    From buck with Apache License 2.0 6 votes vote down vote up
public static void notifyActionToolbar(final Project project) {
  if (!PropertiesComponent.getInstance().isValueSet(GROUP_DISPLAY_ID)) {
    Notifications.Bus.notify(
        new Notification(
            GROUP_DISPLAY_ID,
            "Buck Plugin",
            "<html><a href=''>Enable</a> the toolbar to easily access the buck plugin actions."
                + "<br>You can enable/disable it at any time by pressing on View > Toolbar "
                + "in the menu.</html>",
            NotificationType.INFORMATION,
            new NotificationListener() {
              @Override
              public void hyperlinkUpdate(
                  @NotNull Notification notification, @NotNull HyperlinkEvent hyperlinkEvent) {
                BuckUIManager.getInstance(project).getBuckToolWindow().showMainToolbar();
              }
            }),
        project);
    PropertiesComponent.getInstance().setValue(GROUP_DISPLAY_ID, "true");
  }
}
 
Example #3
Source File: LombokPluginUpdateActivity.java    From lombok-intellij-plugin with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
@Override
public void runActivity(@NotNull Project project) {
  final LombokSettings settings = LombokSettings.getInstance();
  boolean updated = !Version.PLUGIN_VERSION.equals(settings.getVersion());
  if (updated) {
    settings.setVersion(Version.PLUGIN_VERSION);

    NotificationGroup group = new NotificationGroup(Version.PLUGIN_NAME, NotificationDisplayType.STICKY_BALLOON, true);
    Notification notification = group.createNotification(
      LombokBundle.message("daemon.donate.title", Version.PLUGIN_VERSION),
      LombokBundle.message("daemon.donate.content"),
      NotificationType.INFORMATION,
      new NotificationListener.UrlOpeningListener(false)
    );

    Notifications.Bus.notify(notification, project);
  }
}
 
Example #4
Source File: ChangeListStorageImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
public static void notifyUser(String message) {
  final String logFile = ContainerPathManager.get().getLogPath();
  /*String createIssuePart = "<br>" +
                           "<br>" +
                           "Please attach log files from <a href=\"file\">" + logFile + "</a><br>" +
                           "to the <a href=\"url\">YouTrack issue</a>";*/
  Notifications.Bus.notify(new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID,
                                            "Local History is broken",
                                            message /*+ createIssuePart*/,
                                            NotificationType.ERROR,
                                            new NotificationListener() {
                                              @Override
                                              public void hyperlinkUpdate(@Nonnull Notification notification,
                                                                          @Nonnull HyperlinkEvent event) {
                                                if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                                                  if ("url".equals(event.getDescription())) {
                                                    BrowserUtil.launchBrowser("http://youtrack.jetbrains.net/issue/IDEA-71270");
                                                  }
                                                  else {
                                                    File file = new File(logFile);
                                                    ShowFilePathAction.openFile(file);
                                                  }
                                                }
                                              }
                                            }), null);
}
 
Example #5
Source File: StartupManagerImpl.java    From consulo with Apache License 2.0 6 votes vote down vote up
private void checkFsSanity() {
  try {
    String path = myProject.getBasePath();
    if (path == null || FileUtil.isAncestor(ContainerPathManager.get().getConfigPath(), path, true)) {
      return;
    }

    boolean expected = SystemInfo.isFileSystemCaseSensitive;
    boolean actual = FileUtil.isFileSystemCaseSensitive(path);
    LOG.info(path + " case-sensitivity: expected=" + expected + " actual=" + actual);
    if (actual != expected) {
      int prefix = expected ? 1 : 0;  // IDE=true -> FS=false -> prefix='in'
      String title = ApplicationBundle.message("fs.case.sensitivity.mismatch.title");
      String text = ApplicationBundle.message("fs.case.sensitivity.mismatch.message", prefix);
      Notifications.Bus.notify(new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, title, text, NotificationType.WARNING, NotificationListener.URL_OPENING_LISTENER), myProject);
    }

    //ProjectFsStatsCollector.caseSensitivity(myProject, actual);
  }
  catch (FileNotFoundException e) {
    LOG.warn(e);
  }
}
 
Example #6
Source File: NotificationsUtil.java    From consulo with Apache License 2.0 6 votes vote down vote up
@Nullable
public static HyperlinkListener wrapListener(@Nonnull final Notification notification) {
  final NotificationListener listener = notification.getListener();
  if (listener == null) return null;

  return new HyperlinkListener() {
    public void hyperlinkUpdate(HyperlinkEvent e) {
      if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        final NotificationListener listener1 = notification.getListener();
        if (listener1 != null) {
          listener1.hyperlinkUpdate(notification, e);
        }
      }
    }
  };
}
 
Example #7
Source File: DvcsBranchPopup.java    From consulo with Apache License 2.0 6 votes vote down vote up
private void notifyAboutSyncedBranches() {
  String description = "You have several " +
                       myVcs.getDisplayName() +
                       " roots in the project and they all are checked out at the same branch. " +
                       "We've enabled synchronous branch control for the project. <br/>" +
                       "If you wish to control branches in different roots separately, " +
                       "you may <a href='settings'>disable</a> the setting.";
  NotificationListener listener = new NotificationListener() {
    @Override
    public void hyperlinkUpdate(@Nonnull Notification notification, @Nonnull HyperlinkEvent event) {
      if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
        ShowSettingsUtil.getInstance().showSettingsDialog(myProject, myVcs.getConfigurable().getDisplayName());
        if (myVcsSettings.getSyncSetting() == DvcsSyncSettings.Value.DONT_SYNC) {
          notification.expire();
        }
      }
    }
  };
  VcsNotifier.getInstance(myProject).notifyImportantInfo("Synchronous branch control enabled", description, listener);
}
 
Example #8
Source File: GitHubErrorReporter.java    From IntelliJDeodorant with MIT License 6 votes vote down vote up
@Override
public void consume(SubmittedReportInfo reportInfo) {
    myOriginalConsumer.consume(reportInfo);

    if (reportInfo.getStatus().equals(SubmittedReportInfo.SubmissionStatus.FAILED)) {
        ReportMessages.GROUP.createNotification(
                ReportMessages.ERROR_REPORT,
                reportInfo.getLinkText(),
                NotificationType.ERROR,
                NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(myProject);
    } else {
        ReportMessages.GROUP.createNotification(
                ReportMessages.ERROR_REPORT,
                reportInfo.getLinkText(),
                NotificationType.INFORMATION,
                NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(myProject);
    }
}
 
Example #9
Source File: ConsoleLog.java    From aem-ide-tooling-4-intellij with Apache License 2.0 5 votes vote down vote up
@Override
public void navigate(Project project) {
    NotificationListener listener = myNotification.getListener();
    if(listener != null) {
        ConsoleLogConsole console = ObjectUtils.assertNotNull(getProjectComponent(project).getConsole(myNotification));
        JComponent component = console.getConsoleEditor().getContentComponent();
        listener.hyperlinkUpdate(myNotification, IJSwingUtilities.createHyperlinkEvent(myHref, component));
    }
}
 
Example #10
Source File: GtNotifierImpl.java    From GitToolBox with Apache License 2.0 5 votes vote down vote up
@NotNull
private Notification notify(@NotNull NotificationGroup notificationGroup,
                            @NotNull String title,
                            @NotNull String message,
                            @NotNull NotificationType type,
                            @Nullable NotificationListener listener) {
  Notification notification = createNotification(notificationGroup, title, message, type, listener);
  return notify(notification);
}
 
Example #11
Source File: GtNotifierImpl.java    From GitToolBox with Apache License 2.0 5 votes vote down vote up
@NotNull
private Notification createNotification(@NotNull NotificationGroup notificationGroup,
                                        @NotNull String title,
                                        @NotNull String message,
                                        @NotNull NotificationType type,
                                        @Nullable NotificationListener listener) {
  // title can be empty; message can't be neither null, nor empty
  if (StringUtil.isEmptyOrSpaces(message)) {
    message = title;
    title = "";
  }
  // if both title and message were empty, then it is a problem in the calling code =>
  // Notifications engine assertion will notify.
  return notificationGroup.createNotification(title, message, type, listener);
}
 
Example #12
Source File: UploadNotification.java    From markdown-image-kit with MIT License 5 votes vote down vote up
/**
 * Notify upload failure.
 *
 * @param fileNotFoundListMap   the file not found list map
 * @param uploadFailuredListMap the upload failured list map
 * @param project               the project
 */
public static void notifyUploadFailure(Map<VirtualFile, List<String>> fileNotFoundListMap,
                                       Map<VirtualFile, List<String>> uploadFailuredListMap,
                                       Project project) {
    StringBuilder content = new StringBuilder();

    StringBuilder fileNotFoundContent = new StringBuilder();
    StringBuilder uploadFailuredContent = new StringBuilder();

    if (fileNotFoundListMap.size() > 0) {
        buildContent(fileNotFoundListMap, fileNotFoundContent, "Image Not Found:");
    }

    if (uploadFailuredListMap.size() > 0) {
        buildContent(uploadFailuredListMap, uploadFailuredContent, "Image Upload Failured:");
    }
    content.append(fileNotFoundContent).append(uploadFailuredContent);
    Notifications.Bus.notify(new Notification(MIK_NOTIFICATION_GROUP, "Upload Warning",
                                              content.toString(), NotificationType.WARNING, new NotificationListener.Adapter() {
        @Override
        protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
            URL url = e.getURL();
            if (url != null) {
                try {
                    ShowFilePathAction.openFile(new File(url.toURI()));
                } catch (URISyntaxException ex) {
                    log.warn("invalid URL: " + url, ex);
                }
            }
            hideBalloon(notification.getBalloon());
        }
    }), project);
}
 
Example #13
Source File: NotificationData.java    From consulo with Apache License 2.0 5 votes vote down vote up
public NotificationData(@Nonnull String title,
                        @Nonnull String message,
                        @Nonnull NotificationCategory notificationCategory,
                        @Nonnull NotificationSource notificationSource,
                        @Nullable String filePath,
                        int line,
                        int column,
                        boolean balloonNotification) {
  myTitle = title;
  myMessage = message;
  myNotificationCategory = notificationCategory;
  myNotificationSource = notificationSource;
  myListenerMap = ContainerUtil.newHashMap();
  myListener = new NotificationListener.Adapter() {
    @Override
    protected void hyperlinkActivated(@Nonnull Notification notification, @Nonnull HyperlinkEvent event) {
      if (event.getEventType() != HyperlinkEvent.EventType.ACTIVATED) return;

      final NotificationListener notificationListener = myListenerMap.get(event.getDescription());
      if (notificationListener != null) {
        notificationListener.hyperlinkUpdate(notification, event);
      }
    }
  };
  myFilePath = filePath;
  myLine = line;
  myColumn = column;
  myBalloonNotification = balloonNotification;
}
 
Example #14
Source File: BehindTrackerUiService.java    From GitToolBox with Apache License 2.0 5 votes vote down vote up
BehindTrackerUiService(@NotNull Project project) {
  this.project = project;
  updateProjectListener = new NotificationListener.Adapter() {
    @Override
    protected void hyperlinkActivated(@NotNull Notification notification,
                                      @NotNull HyperlinkEvent hyperlinkEvent) {
      UpdateProject.create(project).execute(hyperlinkEvent.getInputEvent());
    }
  };
}
 
Example #15
Source File: GaugeExceptionHandler.java    From Intellij-Plugin with Apache License 2.0 5 votes vote down vote up
private Notification createNotification(String stacktrace, int exitValue) {
    IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.findId("com.thoughtworks.gauge"));
    String pluginVersion = plugin == null ? "" : plugin.getVersion();
    String apiVersion = ApplicationInfo.getInstance().getApiVersion();
    String ideaVersion = ApplicationInfo.getInstance().getFullVersion();
    String gaugeVersion = GaugeVersion.getVersion(false).version;
    String body = String.format(ISSUE_TEMPLATE, exitValue,stacktrace, ideaVersion, apiVersion, pluginVersion, gaugeVersion);
    String content = String.format(NOTIFICATION_TEMPLATE, LINE_BREAK, body);
    return new Notification("Gauge Exception", NOTIFICATION_TITLE, content, NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER);
}
 
Example #16
Source File: ESLintProjectComponent.java    From eslint-plugin with MIT License 5 votes vote down vote up
private void validationFailed(String msg) {
    NotificationListener notificationListener = new NotificationListener() {
        @Override
        public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
            ESLintInspection.showSettings(project);
        }
    };
    String errorMessage = msg + FIX_CONFIG_HREF;
    showInfoNotification(errorMessage, NotificationType.WARNING, notificationListener);
    LOG.debug(msg);
    settingValidStatus = false;
}
 
Example #17
Source File: EditableNotificationMessageElement.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
  if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
    final NotificationListener notificationListener = myNotification.getListener();
    if (notificationListener != null) {
      notificationListener.hyperlinkUpdate(myNotification, e);
    }
  }
}
 
Example #18
Source File: UnknownMacroNotification.java    From consulo with Apache License 2.0 5 votes vote down vote up
public UnknownMacroNotification(@Nonnull String groupId,
                                @Nonnull String title,
                                @Nonnull String content,
                                @Nonnull NotificationType type,
                                @Nullable NotificationListener listener,
                                @Nonnull Collection<String> macros) {
  super(groupId, title, content, type, listener);

  myMacros = macros;
}
 
Example #19
Source File: RTProjectComponent.java    From react-templates-plugin with MIT License 5 votes vote down vote up
private void validationFailed(String msg) {
        NotificationListener notificationListener = new NotificationListener() {
            @Override
            public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
//                ESLintInspection.showSettings(project);
            }
        };
        String errorMessage = msg + FIX_CONFIG_HREF;
        showInfoNotification(errorMessage, NotificationType.WARNING, notificationListener);
        LOG.debug(msg);
        settingValidStatus = false;
    }
 
Example #20
Source File: JscsProjectComponent.java    From jscs-plugin with MIT License 5 votes vote down vote up
private void validationFailed(String msg) {
    NotificationListener notificationListener = new NotificationListener() {
        @Override
        public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
            JscsInspection.showSettings(project);
        }
    };
    String errorMessage = msg + FIX_CONFIG_HREF;
    showInfoNotification(errorMessage, NotificationType.WARNING, notificationListener);
    LOG.debug(msg);
    settingValidStatus = false;
}
 
Example #21
Source File: VcsRootProblemNotifier.java    From consulo with Apache License 2.0 5 votes vote down vote up
public void rescanAndNotifyIfNeeded() {
  Collection<VcsRootError> errors = scan();
  if (errors.isEmpty()) {
    synchronized (NOTIFICATION_LOCK) {
      expireNotification();
    }
    return;
  }

  Collection<VcsRootError> importantUnregisteredRoots = getImportantUnregisteredMappings(errors);
  Collection<VcsRootError> invalidRoots = getInvalidRoots(errors);

  List<String> unregRootPaths = ContainerUtil.map(importantUnregisteredRoots, PATH_FROM_ROOT_ERROR);
  if (invalidRoots.isEmpty() && (importantUnregisteredRoots.isEmpty() || myReportedUnregisteredRoots.containsAll(unregRootPaths))) {
    return;
  }
  myReportedUnregisteredRoots.addAll(unregRootPaths);

  String title = makeTitle(importantUnregisteredRoots, invalidRoots);
  String description = makeDescription(importantUnregisteredRoots, invalidRoots);

  synchronized (NOTIFICATION_LOCK) {
    expireNotification();
    NotificationListener listener = new MyNotificationListener(myProject, mySettings, myVcsManager, importantUnregisteredRoots);
    VcsNotifier notifier = VcsNotifier.getInstance(myProject);
    myNotification = invalidRoots.isEmpty()
                     ? notifier.notifyMinorInfo(title, description, listener)
                     : notifier.notifyError(title, description, listener);
  }
}
 
Example #22
Source File: RTProjectComponent.java    From react-templates-plugin with MIT License 5 votes vote down vote up
private void validationFailed(String msg) {
        NotificationListener notificationListener = new NotificationListener() {
            @Override
            public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
//                ESLintInspection.showSettings(project);
            }
        };
        String errorMessage = msg + FIX_CONFIG_HREF;
        showInfoNotification(errorMessage, NotificationType.WARNING, notificationListener);
        LOG.debug(msg);
        settingValidStatus = false;
    }
 
Example #23
Source File: CreateBranchModelTest.java    From azure-devops-intellij with MIT License 5 votes vote down vote up
@Test
@SuppressWarnings("unchecked")
public void testDoBranchCreate_Success() {
    GitRefUpdateResult result = new GitRefUpdateResult();
    result.setSuccess(true);
    when(mockClient.updateRefs(any(List.class), any(UUID.class), any(String.class))).thenReturn(ImmutableList.of(result));
    when(mockContext.getGitHttpClient()).thenReturn(mockClient);

    underTest = new CreateBranchModel(mockProject, defaultBranchName, mockGitRepository);
    underTest.setBranchName("testBranch");
    assertTrue(underTest.doBranchCreate(mockContext, null));
    assertTrue(underTest.getBranchWasCreated());
    verify(mockVcsNotifier).notifyImportantInfo(eq(TfPluginBundle.message(TfPluginBundle.KEY_CREATE_BRANCH_DIALOG_SUCCESSFUL_TITLE)), any(String.class), any(NotificationListener.class));

}
 
Example #24
Source File: WorkspaceModelTest.java    From azure-devops-intellij with MIT License 5 votes vote down vote up
@Test
public void testSaveWorkspaceInternal() {
    final WorkspaceModel m = new WorkspaceModel();
    final Workspace newWorkspace = new Workspace(server, name, computer, owner, comment, mappings);
    final Workspace oldWorkspace = new Workspace(server, name + "old", computer, owner, comment, mappings);
    m.saveWorkspaceInternal(authenticatedContext, oldWorkspace, newWorkspace, null, mockProject, "/path", true, null);
    verify(mockVcsNotifier).notifyImportantInfo(anyString(), anyString(), any(NotificationListener.class));
}
 
Example #25
Source File: StatisticsSendManager.java    From consulo with Apache License 2.0 5 votes vote down vote up
public Notification createNotification(@Nonnull final String groupDisplayId, @Nullable NotificationListener listener) {
  final String fullProductName = ApplicationNamesInfo.getInstance().getFullProductName();
  final String companyName = ApplicationInfo.getInstance().getCompanyName();

  String text = "<html>Please click <a href='allow'>I agree</a> if you want to help make " +
                fullProductName +
                " better or <a href='decline'>I don't agree</a> otherwise. <a href='settings'>more...</a></html>";

  String title = "Help improve " + fullProductName + " by sending anonymous usage statistics to " + companyName;

  return new Notification(groupDisplayId, title, text, NotificationType.INFORMATION, listener);
}
 
Example #26
Source File: XDebugSessionImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Override
public void reportMessage(@Nonnull final String message, @Nonnull final MessageType type, @Nullable final HyperlinkListener listener) {
  NotificationListener notificationListener = listener == null ? null : (notification, event) -> {
    if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
      listener.hyperlinkUpdate(event);
    }
  };
  NOTIFICATION_GROUP.createNotification("", message, type.toNotificationType(), notificationListener).notify(myProject);
}
 
Example #27
Source File: VcsPullRequestsModel.java    From azure-devops-intellij with MIT License 5 votes vote down vote up
private void notifyOperationStatus(final boolean success, final String message) {
    if (success) {
        VcsNotifier.getInstance(project).notifySuccess(
                TfPluginBundle.message(TfPluginBundle.KEY_VCS_PR_TITLE), message, NotificationListener.URL_OPENING_LISTENER);
    } else {
        VcsNotifier.getInstance(project).notifyError(
                TfPluginBundle.message(TfPluginBundle.KEY_VCS_PR_TITLE), message, NotificationListener.URL_OPENING_LISTENER);
    }

    // Update the PR tab and any other UI that is listening for PR Changed events (even on failure updating the tab is a good idea)
    EventContextHelper.triggerPullRequestChanged(EventContextHelper.SENDER_ABANDON_PULL_REQUEST, project);
}
 
Example #28
Source File: UserMessage.java    From p4ic4idea with Apache License 2.0 5 votes vote down vote up
public static void showNotification(@Nullable Project project, int level,
        @NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String message,
        @NotNull @Nls(capitalization = Nls.Capitalization.Title) String title,
        @NotNull NotificationType icon, @Nullable NotificationListener question,
        @Nullable Runnable onMessageExpired) {
    if (UserProjectPreferences.isUserMessageLevel(project, level)) {
        Notification notification = createNotification(P4Vcs.VCS_NAME, title, message, icon, question, onMessageExpired);
        Notifications.Bus.notify(notification, project);
    }
}
 
Example #29
Source File: CreatePullRequestModel.java    From azure-devops-intellij with MIT License 5 votes vote down vote up
private void notifySuccess(final Project project, final String title, final String message) {
    VcsNotifier.getInstance(project).notifyImportantInfo(title, message, new NotificationListener() {
        @Override
        public void hyperlinkUpdate(@NotNull final Notification n, @NotNull final HyperlinkEvent e) {
            BrowserUtil.browse(e.getURL());
        }
    });

    // Update the PR tab and any other UI that is listening for PR Changed events
    EventContextHelper.triggerPullRequestChanged(EventContextHelper.SENDER_CREATE_PULL_REQUEST, project);
}
 
Example #30
Source File: ProjectLoadingErrorsNotifierImpl.java    From consulo with Apache License 2.0 5 votes vote down vote up
private void fireNotifications() {
  final MultiMap<ConfigurationErrorType, ConfigurationErrorDescription> descriptionsMap = new MultiMap<ConfigurationErrorType, ConfigurationErrorDescription>();
  synchronized (myLock) {
    if (myErrors.isEmpty()) return;
    descriptionsMap.putAllValues(myErrors);
    myErrors.clear();
  }

  for (final ConfigurationErrorType type : descriptionsMap.keySet()) {
    final Collection<ConfigurationErrorDescription> descriptions = descriptionsMap.get(type);
    if (descriptions.isEmpty()) continue;

    final String invalidElements = getInvalidElementsString(type, descriptions);
    final String errorText = ProjectBundle.message("error.message.configuration.cannot.load") + " " + invalidElements + " <a href=\"\">Details...</a>";

    Notifications.Bus.notify(new Notification("Project Loading Error", "Error Loading Project", errorText, NotificationType.ERROR, new NotificationListener() {
      @Override
      public void hyperlinkUpdate(@Nonnull Notification notification, @Nonnull HyperlinkEvent event) {
        final List<ConfigurationErrorDescription> validDescriptions = ContainerUtil.findAll(descriptions, new Condition<ConfigurationErrorDescription>() {
          @Override
          public boolean value(ConfigurationErrorDescription errorDescription) {
            return errorDescription.isValid();
          }
        });
        RemoveInvalidElementsDialog.showDialog(myProject, CommonBundle.getErrorTitle(), type, invalidElements, validDescriptions);

        notification.expire();
      }
    }), myProject);
  }

}