@Override public void consume(Exception e) { String message = String.format( "<html>\n" + " There was an error while creating a GitHub issue: %s\n" + " <br>\n" + " Please consider <a href=\"" + ISSUES_URL + "/new\">manually creating an issue</a>\n" + "</html>", e.getMessage() ); ReportMessages.GROUP.createNotification( ReportMessages.ERROR_REPORT, message, NotificationType.ERROR, NotificationListener.URL_OPENING_LISTENER ).setImportant(false).notify(project); } };
private void notifyAboutShortcutConflict(@NotNull final KeyStroke keyStroke) { VimPlugin.getKey().getSavedShortcutConflicts().put(keyStroke, ShortcutOwner.VIM); final String message = String.format( "Using the <b>%s</b> shortcut for Vim emulation.<br/>" + "You can redefine it as an <a href='#ide'>IDE shortcut</a> or " + "configure its handler in <a href='#settings'>Vim Emulation</a> settings.", KeymapUtil.getShortcutText(new KeyboardShortcut(keyStroke, null))); final NotificationListener listener = new NotificationListener.Adapter() { @Override protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { final String description = e.getDescription(); if ("#ide".equals(description)) { VimPlugin.getKey().getSavedShortcutConflicts().put(keyStroke, ShortcutOwner.IDE); notification.expire(); } else if ("#settings".equals(description)) { ShowSettingsUtil.getInstance().editConfigurable((Project)null, new VimEmulationConfigurable()); } } }; final Notification notification = new Notification(VimPlugin.IDEAVIM_NOTIFICATION_ID, VimPlugin.IDEAVIM_NOTIFICATION_TITLE, message, NotificationType.INFORMATION, listener); notification.notify(null); }
private void displayNewUserNotification() { Notification notification = new Notification( NOTIFICATION_GROUP.getDisplayId(), NOTIFICATION_TITLE, "The google-java-format plugin is disabled by default. " + "<a href=\"enable\">Enable for this project</a>.", NotificationType.INFORMATION, (n, e) -> { settings.setEnabled(true); n.expire(); }); notification.notify(project); } }
@Override public void consume(Boolean opened) { String url = null; String linkText = null; //noinspection ConstantConditions final SubmittedReportInfo reportInfo = new SubmittedReportInfo( url, linkText, SubmittedReportInfo.SubmissionStatus.NEW_ISSUE ); consumer.consume(reportInfo); // pseudo-named-arguments NotificationListener notificationListener = null; //noinspection ConstantConditions ReportMessages.GROUP.createNotification( ReportMessages.ERROR_REPORT, "Submitted", NotificationType.INFORMATION, notificationListener ).setImportant(false).notify(project); } };
private void notify(String message, NotificationType notificationType) { MONGO_GROUP.createNotification("[MongoPlugin] " + message, notificationType) .notify(project); } }
public static void showInfo(final Project project, final String infoText) { BALLOON_GROUP .createNotification("", infoText, INFORMATION, URL_OPENING_LISTENER) .notify(project); }
public static void showWarning(final Project project, final String warningText) { BALLOON_GROUP .createNotification("", warningText, WARNING, URL_OPENING_LISTENER) .notify(project); }
public static void showError(final Project project, final String errorText) { BALLOON_GROUP .createNotification("", errorText, ERROR, URL_OPENING_LISTENER) .notify(project); }
public static void showException(final Project project, final Throwable t) { LOG_ONLY_GROUP .createNotification(titleFor(t), messageFor(t), ERROR, URL_OPENING_LISTENER) .notify(project); }
public static void addWarning(Project project, String text) { if (ApplicationManager.getApplication().isUnitTestMode()) { //noinspection UseOfSystemOutOrSystemErr System.out.println(text); } else { GenerateAction.LOG_GROUP.createNotification(text, MessageType.WARNING).notify(project); } }
private static void notifyServiceAccountError(Project project, String name, String errorMessage) { Notification notification = NOTIFICATION_GROUP.createNotification( GoogleCloudApisMessageBundle.message("cloud.apis.service.account.created.error.title"), null /*subtitle*/, GoogleCloudApisMessageBundle.message( "cloud.apis.service.account.created.error.message", name, errorMessage), NotificationType.ERROR); notification.notify(project); }
private void notifyImportNotFinishedYet(@NotNull Project project) { final String notificationTitle = refresh ? message("project.refresh.notification.title") : message("project.import.notification.title"); NotificationUtil.NOTIFICATION_GROUP.createNotification( notificationTitle, message("import.or.refresh.process.not.finished.yet"), NotificationType.INFORMATION, null ).notify(project); }
private void notifyMissingAppEngineWebXml() { Notification notification = NOTIFICATION_GROUP.createNotification( AppEngineMessageBundle.message("appengine.run.nosuchfileexception.title"), null /* subtitle */, AppEngineMessageBundle.message("appengine.run.nosuchfileexception.message"), NotificationType.ERROR); notification.notify(null /* project */); }
void notifyServerIdInvalid() { if (shown) { return; } Notification notification = new Notification(GROUP_BINDING_PROBLEM, "<b>SonarLint - Project bound to invalid SonarQube server</b>", UPDATE_BINDING_MSG, NotificationType.WARNING, new OpenProjectSettingsNotificationListener(myProject)); notification.setImportant(true); notification.notify(myProject); shown = true; }
void notifyModuleInvalid() { if (shown) { return; } Notification notification = new Notification(GROUP_BINDING_PROBLEM, "<b>SonarLint - Project bound to an invalid remote project</b>", UPDATE_BINDING_MSG, NotificationType.WARNING, new OpenProjectSettingsNotificationListener(myProject)); notification.setImportant(true); notification.notify(myProject); shown = true; }
void notifyServerStorageNeedsUpdate(String serverId) { if (shown) { return; } Notification notification = new Notification(GROUP_BINDING_PROBLEM, "<b>SonarLint - Binding for server '" + serverId + "' outdated</b>", UPDATE_SERVER_MSG, NotificationType.WARNING, new OpenGeneralSettingsNotificationListener(myProject)); notification.setImportant(true); notification.notify(myProject); shown = true; }
private static void notifyApisEnabled( Set<CloudLibrary> libraries, String cloudProjectId, Project project) { Notification notification = NOTIFICATION_GROUP.createNotification( GoogleCloudApisMessageBundle.message("cloud.apis.enabled.title"), null /*subtitle*/, GoogleCloudApisMessageBundle.message( "cloud.apis.enabled.message", cloudProjectId, joinApiNames(libraries)), NotificationType.INFORMATION); notification.notify(project); }
private static void notifyApiEnableSkipped(Set<CloudLibrary> apis, Project project) { Notification notification = NOTIFICATION_GROUP.createNotification( GoogleCloudApisMessageBundle.message("cloud.apis.enable.skipped.title"), null /*subtitle*/, GoogleCloudApisMessageBundle.message( "cloud.apis.enable.skipped.message", joinApiNames(apis)), NotificationType.ERROR); notification.notify(project); }
private static void notifyApiEnableError(Set<CloudLibrary> apis, Project project) { Notification notification = NOTIFICATION_GROUP.createNotification( GoogleCloudApisMessageBundle.message("cloud.apis.enable.error.title"), null /*subtitle*/, GoogleCloudApisMessageBundle.message( "cloud.apis.enable.error.message", joinApiNames(apis)), NotificationType.ERROR); notification.notify(project); }