@Override public void run() { Notification notification = NOTIFICATION_GROUP.createNotification(ANDROID_WIFI_ADB_TITLE, message, type, null); Notifications.Bus.notify(notification); } });
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); } }
@VisibleForTesting void showNotification(String title, String message) { NotificationGroup notification = new NotificationGroup(title, NotificationDisplayType.BALLOON, true); notification .createNotification( title, message, NotificationType.WARNING, null /* notificationListener */) .notify(null /*project*/); } }
private void askUserToDisablePlugins(Collection<IdeaPluginDescriptor> conflictingPlugins) { final String text = formatMessage(conflictingPlugins); NotificationGroup ng = NotificationGroup.balloonGroup("Conflicting Plugins"); ng.createNotification(PLUGIN_NAME, text, NotificationType.WARNING, (notification, event) -> { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { for (IdeaPluginDescriptor foreignPlugin : conflictingPlugins) { PluginManager.disablePlugin(foreignPlugin.getPluginId().toString()); } Application application = ApplicationManager.getApplication(); application.restart(); } }).notify(project); }
public void registerNotifications() { NotificationGroup.balloonGroup(SonarLintProjectNotifications.GROUP_BINDING_PROBLEM); NotificationGroup.balloonGroup(SonarLintProjectNotifications.GROUP_UPDATE_NOTIFICATION); NotificationGroup.balloonGroup(SonarQubeEventNotifications.GROUP_SONARQUBE_EVENT); }
private void notifyNotAppEngineProject(@NotNull Project project) { NotificationGroup notification = new NotificationGroup( AppEngineMessageBundle.message("appengine.tools.menu.deploy.error.title"), NotificationDisplayType.BALLOON, true); notification .createNotification( AppEngineMessageBundle.message("appengine.tools.menu.deploy.error.title"), AppEngineMessageBundle.message("appengine.tools.menu.deploy.error.message"), NotificationType.ERROR, null /*listener*/) .notify(project); }
@Override public void run() { NotificationGroup notificationGroup = NotificationGroup.balloonGroup("Cloud Debugger watcher"); String message = StackdriverDebuggerBundle.getString( .ping(); notificationGroup .createNotification( "", message,
private static void error(@NotNull String title, @NotNull Project project, @Nullable Exception ex) { String message = ex == null ? "" : ExceptionUtil.getUserStackTrace(ex, LOG); NotificationType type = NotificationType.ERROR; Notifications.Bus.notify(GoConstants.GO_EXECUTION_NOTIFICATION_GROUP.createNotification(title, message, type, null), project); }
private void notifyNotAppEngineStandardProject(@NotNull Project project) { NotificationGroup notification = new NotificationGroup( AppEngineMessageBundle.message("appengine.tools.menu.run.server.error.title"), NotificationDisplayType.BALLOON, true); notification .createNotification( AppEngineMessageBundle.message("appengine.tools.menu.run.server.error.title"), AppEngineMessageBundle.message("appengine.tools.menu.run.server.error.message"), NotificationType.ERROR, null /*listener*/) .notify(project); } }
/** * Shows {@link Notification}. * * @param project current project * @param title notification title * @param group notification group * @param content notification text * @param type notification type * @param listener optional listener */ public static void show(@NotNull Project project, @NotNull String title, @NotNull String content, @NotNull NotificationGroup group, @NotNull NotificationType type, @Nullable NotificationListener listener) { Notification notification = group.createNotification(title, content, type, listener); Notifications.Bus.notify(notification, project); } }
private void showNotification(@NotNull IdeaPluginDescriptor plugin) { NotificationGroup notification = new NotificationGroup( AppEngineMessageBundle.message("plugin.conflict.error.title"), NotificationDisplayType.BALLOON, .createNotification( AppEngineMessageBundle.message("plugin.conflict.error.title"), errorMessage,
@Override protected boolean doSomething(@NotNull VirtualFile virtualFile, @Nullable Module module, @NotNull Project project, @NotNull String title) throws ExecutionException { VirtualFile executable = getExecutable(project, module); if (executable == null) { String message = "Can't find `" + myExecutableName + "` in GOPATH. Try to invoke <a href=\"" + GO_GET_LINK + "\">go get " + myExecutableName + "</a>"; NotificationListener listener = new MyNotificationListener(project, module); Notifications.Bus.notify(GoConstants.GO_NOTIFICATION_GROUP.createNotification(title, message, NotificationType.WARNING, listener), project); return false; } return super.doSomething(virtualFile, module, project, title); }
/** * Invoked when project opened, and check if the plugin is * updated and if should * show the notification window. */ @Override public void projectOpened() { if (applicationComponent.isUpdated() && !applicationComponent.isUpdateNotificationShown()) { applicationComponent.setUpdateNotificationShown(true); NotificationGroup balloonNotifications = new NotificationGroup( "Notification group", NotificationDisplayType.BALLOON, true); Notification success = balloonNotifications.createNotification( "HighlightBracketPair is updated to " +HighlightBracketPairSettings.getInstance().getVersion(), "<br/>If this plugin helps you, please give me a star on " + "<b><a href=\"https://github.com/qeesung/HighlightBracketPair\">Github</a>, ^_^.</b>", NotificationType.INFORMATION, new NotificationListener.UrlOpeningListener(true)); Notifications.Bus.notify(success, this.myProject); } }
@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); } };
public void projectOpened() { PerlApplicationSettings settings = PerlApplicationSettings.getInstance(); if (settings.shouldShowAnnounce()) { StartupManager.getInstance(myProject).runWhenProjectIsInitialized(() -> { settings.setAnnounceShown(); NotificationGroup group = new NotificationGroup(PerlBundle.message("plugin.update.baloon.group"), NotificationDisplayType.STICKY_BALLOON, true); Notification notification = group.createNotification( PerlBundle.message("plugin.update.baloon.title", PerlPluginUtil.getPluginVersion()), PerlBundle.message("plugin.update.baloon.text"), NotificationType.INFORMATION, new NotificationListener.UrlOpeningListener(false) ).setImportant(true) .addAction( new BrowseNotificationAction(PerlBundle.message("plugin.update.baloon.changes"), "https://plugins.jetbrains.com/plugin/7796")) .addAction(new BrowseNotificationAction(PerlBundle.message("plugin.update.baloon.tracker"), "https://github.com/hurricup/Perl5-IDEA/issues")) .addAction(new BrowseNotificationAction(PerlBundle.message("plugin.update.baloon.support"), "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HJCUADZKY5G7E")); Notifications.Bus.notify(notification); }); } StartupManager.getInstance(myProject).runWhenProjectIsInitialized(() -> { PerlNamesCache.getInstance(myProject).forceCacheUpdate(); ApplicationManager.getApplication().invokeLater(FileContentUtil::reparseOpenedFiles); }); }
private void showNotification(@NotNull String message, NotificationType type) { ApplicationManager.getApplication().invokeLater(() -> { String title = getPresentableName(); Notifications.Bus.notify(GoConstants.GO_EXECUTION_NOTIFICATION_GROUP.createNotification(title, message, type, null), myProject); }); }
private void showNotification(@NotNull String message, NotificationType type) { ApplicationManager.getApplication().invokeLater(() -> { String title = getPresentableName(); Notifications.Bus.notify(BallerinaConstants.BALLERINA_EXECUTION_NOTIFICATION_GROUP .createNotification(title, message, type, null), myProject); }); }
@Override public void initComponent() { PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(); boolean wasDisplayed; //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (propertiesComponent) { wasDisplayed = propertiesComponent.getBoolean(GO_PROJECT_TUTORIAL_NOTIFICATION_SHOWN, false); propertiesComponent.setValue(GO_PROJECT_TUTORIAL_NOTIFICATION_SHOWN, true); } if (wasDisplayed) return; Notifications.Bus.notify(GoConstants.GO_NOTIFICATION_GROUP.createNotification("Learn how to setup a new Go project", "Please visit our " + "<a href=\"https://github.com/go-lang-plugin-org/go-lang-idea-plugin/wiki/v1.0.0-Setup-initial-project\">wiki page<a/>" + " to learn how to setup a new Go project", NotificationType.INFORMATION, NotificationListener.URL_OPENING_LISTENER)); }
private static void showNotification(@NotNull Project project) { PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(); PropertiesComponent projectPropertiesComponent = PropertiesComponent.getInstance(project); boolean shownAlready; //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (propertiesComponent) { shownAlready = propertiesComponent.getBoolean(GO_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, false) || projectPropertiesComponent.getBoolean(GO_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, false); if (!shownAlready) { propertiesComponent.setValue(GO_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, String.valueOf(true)); } } if (!shownAlready) { NotificationListener.Adapter notificationListener = new NotificationListener.Adapter() { @Override protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED && "configure".equals(event.getDescription())) { GoLibrariesConfigurableProvider.showModulesConfigurable(project); } } }; Notification notification = GoConstants.GO_NOTIFICATION_GROUP.createNotification("GOPATH was detected", "We've detected some libraries from your GOPATH.\n" + "You may want to add extra libraries in <a href='configure'>Go Libraries configuration</a>.", NotificationType.INFORMATION, notificationListener); Notifications.Bus.notify(notification, project); } }
private static void showNotification(@NotNull Project project) { PropertiesComponent propertiesComponent = PropertiesComponent.getInstance(); PropertiesComponent projectPropertiesComponent = PropertiesComponent.getInstance(project); boolean shownAlready; //noinspection SynchronizationOnLocalVariableOrMethodParameter synchronized (propertiesComponent) { shownAlready = propertiesComponent.getBoolean(BALLERINA_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, false) || projectPropertiesComponent.getBoolean(BALLERINA_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, false); if (!shownAlready) { propertiesComponent.setValue(BALLERINA_LIBRARIES_NOTIFICATION_HAD_BEEN_SHOWN, String.valueOf(true)); } } if (!shownAlready) { NotificationListener.Adapter notificationListener = new NotificationListener.Adapter() { @Override protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED && "configure".equals(event.getDescription())) { BallerinaLibrariesConfigurableProvider.showModulesConfigurable(project); } } }; Notification notification = BallerinaConstants.BALLERINA_NOTIFICATION_GROUP.createNotification("BALLERINA_REPOSITORY was " + "detected", "We've detected some packages from your BALLERINA_REPOSITORY.\n", NotificationType.INFORMATION, notificationListener); Notifications.Bus.notify(notification, project); } }