public static void sendNotification(String message, NotificationType notificationType) { if(message == null || message.trim().length()==0){ return; } Notification notification = new Notification("com.dim.plugin.Gsonformat", "Gsonformat ", espaceString(message), notificationType); Notifications.Bus.notify(notification); }
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); } }
/** * Creates new user template. */ private void performCreateAction() { IgnoreSettings.UserTemplate template = new IgnoreSettings.UserTemplate(name.getText(), previewDocument.getText()); settings.getUserTemplates().add(template); Notifications.Bus.notify(new Notification( IgnoreBundle.PLUGIN_ID, IgnoreBundle.message("dialog.userTemplate.added"), IgnoreBundle.message("dialog.userTemplate.added.description", template.getName()), NotificationType.INFORMATION ), project); super.doOKAction(); } }
new Notification( VimPlugin.IDEAVIM_STICKY_NOTIFICATION_ID, VimPlugin.IDEAVIM_NOTIFICATION_TITLE, new Notification( VimPlugin.IDEAVIM_STICKY_NOTIFICATION_ID, VimPlugin.IDEAVIM_NOTIFICATION_TITLE,
private void notifyFailure(final Exception exception) { Notification notification = new Notification( "Swagger UI", "Could not generate Swagger UI", exception.getMessage(), NotificationType.WARNING); Notifications.Bus.notify(notification); }
private static void showInfoNotification(@NotNull Project project, @NotNull String content) { Notifications.Bus.notify(new Notification(SymfonyInstallerUtil.INSTALLER_GROUP_DISPLAY_ID, "Symfony-Installer", content, NotificationType.INFORMATION, null), project); }
public void showInfoNotification(String content) { Notification errorNotification = new Notification("Symfony Plugin", "Symfony Plugin", content, NotificationType.INFORMATION); Notifications.Bus.notify(errorNotification, this.project); }
private static void showErrorNotification(@NotNull Project project, @NotNull String content) { Notifications.Bus.notify(new Notification(SymfonyInstallerUtil.INSTALLER_GROUP_DISPLAY_ID, "Symfony-Installer", content, NotificationType.ERROR, null), project); }
dialog = new GeneratorDialog(project, action); } else { Notifications.Bus.notify(new Notification( fileType.getLanguageName(), IgnoreBundle.message("action.newFile.exists", fileType.getLanguageName()),
public static void notifyEnableMessage(final Project project) { Notification notification = new Notification("Symfony Plugin", "Symfony Plugin", "Enable the Symfony Plugin <a href=\"enable\">with auto configuration now</a>, open <a href=\"config\">Project Settings</a> or <a href=\"dismiss\">dismiss</a> further messages", NotificationType.INFORMATION, (notification1, event) -> { // handle html click events if("config".equals(event.getDescription())) { // open settings dialog and show panel SettingsForm.show(project); } else if("enable".equals(event.getDescription())) { enablePluginAndConfigure(project); Notifications.Bus.notify(new Notification("Symfony Plugin", "Symfony Plugin", "Plugin enabled", NotificationType.INFORMATION), project); } else if("dismiss".equals(event.getDescription())) { // user doesnt want to show notification again Settings.getInstance(project).dismissEnableNotification = true; } notification1.expire(); }); Notifications.Bus.notify(notification, project); }
protected Notification get() { Notification notification = new Notification(GERRIT_NOTIFICATION_GROUP, title, message, type, listener.orNull()); if (!showBalloon) { notification.expire(); } return notification; }
static void fail(@NotNull Project project, @NotNull String title, @NotNull String message) { Notifications.Bus.notify(new Notification( BnfConstants.GENERATION_GROUP, title, message, NotificationType.ERROR), project); throw new ProcessCanceledException(); } }
public static void displayToolsNotification(@NotNull final NotificationType type, @NotNull final Project project, @NotNull final String title, @NotNull final String message) { Notifications.Bus.notify(new Notification( title, title, message.replace("\n", "<br/>") + "<br/><a href='configureDTools'>Configure</a>", type, new DToolsNotificationListener(project)), project); } }
public static void warn(String text) { if (LEVEL > WARN) { Notifications.Bus.notify( new Notification(NAME, NAME + " [WARN]", redirect(text), NotificationType.WARNING)); } }
public static void debug(String text) { if (LEVEL >= DEBUG) { Notifications.Bus.notify( new Notification(NAME, NAME + " [DEBUG]", redirect(text), NotificationType.INFORMATION)); } }
public static void error(String text) { if (LEVEL > ERROR) { Notifications.Bus.notify( new Notification(NAME, NAME + " [ERROR]", redirect(text), NotificationType.ERROR)); } }
public static void showTopic(Project project, String title, String content, NotificationType type) { project.getMessageBus().syncPublisher(Notifications.TOPIC).notify( new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, title, content, type)); }
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 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; }