@Override public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { String description = event.getDescription(); if (GO_GET_LINK.equals(description)) { GoGetPackageFix.applyFix(myProject, myModule, myGoGetImportPath, false); notification.expire(); } } } }
@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()); } } };
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); } }
/** * {@link IgnoreManager.TrackedIgnoredListener} method implementation to handle incoming files. * * @param files tracked and ignored files list */ @Override public void handleFiles(@NotNull final ConcurrentMap<VirtualFile, VcsRoot> files) { if (!settings.isInformTrackedIgnored() || notificationShown || myProject.getBaseDir() == null) { return; } notificationShown = true; Notify.show( myProject, IgnoreBundle.message("notification.untrack.title", Utils.getVersion()), IgnoreBundle.message("notification.untrack.content"), NotificationType.INFORMATION, (notification, event) -> { if (DISABLE_ACTION.equals(event.getDescription())) { settings.setInformTrackedIgnored(false); } else if (!myProject.isDisposed()) { new UntrackFilesDialog(myProject, files).show(); } notification.expire(); } ); } }
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); }
@Override public void actionPerformed(AnActionEvent e) { disableListener.actionPerformed(new ActionEvent(notification, 0, "")); notification.expire(); } });
@Override public void actionPerformed(AnActionEvent e) { cancelListener.actionPerformed(new ActionEvent(notification, 0, "")); notification.expire(); } });
@Override public void actionPerformed(AnActionEvent e) { statistics.suppressItem(myAction); myNotification.expire(); } }
protected Notification get() { Notification notification = new Notification(GERRIT_NOTIFICATION_GROUP, title, message, type, listener.orNull()); if (!showBalloon) { notification.expire(); } return notification; }
@Override public void actionPerformed(@NotNull AnActionEvent e) { Perl5SettingsConfigurable.open(project); notification.expire(); } });
@Override public void actionPerformed(AnActionEvent e) { ShowSettingsUtil.getInstance() .showSettingsDialog( null /* IDE-wide settings, no project needed. */, CloudSdkConfigurable.class); // expire if action has been called to avoid error hanging out forever. invalidSdkWarning.expire(); } });
/** * Shows the settings dialog when the user presses "configure" on a balloon. */ @Override public void hyperlinkUpdate(@NotNull final Notification notification, @NotNull final HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (event.getDescription().equals("configureDLanguageTools") && !myProject.isDisposed()) { ShowSettingsUtil.getInstance().showSettingsDialog(myProject, DLanguageToolsConfigurable.D_TOOLS_ID); notification.expire(); } } } }
@Override public void hyperlinkUpdate(Notification notification, HyperlinkEvent event) { if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { final String description = event.getDescription(); if ("allow".equals(description)) { usageTrackingManagementService.setTrackingPreference(true); notification.expire(); } else if ("decline".equals(description)) { usageTrackingManagementService.setTrackingPreference(false); notification.expire(); } else if ("policy".equals(description)) { try { BrowserUtil.browse(new URL(UsageTrackerPanel.PRIVACY_POLICY_URL)); } catch (MalformedURLException ex) { LOG.error(ex); } notification.expire(); } else if ("settings".equals(description)) { final ShowSettingsUtil util = ShowSettingsUtil.getInstance(); util.showSettingsDialog(null, UsageTrackerConfigurable.class); notification.expire(); } } } };
@Override protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { if (project != null && !project.isDisposed()) { SonarLintProjectConfigurable configurable = new SonarLintProjectConfigurable(project); ShowSettingsUtil.getInstance().editConfigurable(project, configurable); } else { notification.expire(); } } }
@Override protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { if (project != null && !project.isDisposed()) { SonarLintGlobalConfigurable configurable = new SonarLintGlobalConfigurable(); ShowSettingsUtil.getInstance().editConfigurable(project, configurable); } else { notification.expire(); } } }
notification.expire(); } : null; ReportMessages.GROUP.createNotification(ReportMessages.ERROR_REPORT, text.toString(), type, listener).notify(project);
static void askToCreateShortcut(KeyPromoterAction action) { final int maxTips = settings.getMaxNumberOfTips(); if (maxTips != 0 && NOTIFICATION_LIST.size() >= maxTips) { final Notification notification = NOTIFICATION_LIST.removeFirst(); notification.expire(); } Notification notification = GROUP.createNotification( KeyPromoterBundle.message("kp.notification.group"), KeyPromoterBundle.message("kp.notification.ask.new.shortcut", action.getDescription()), NotificationType.INFORMATION, null ).setIcon(KeyPromoterIcons.KP_ICON) .addAction(new EditKeymapAction(action)); notification.addAction(new SuppressTipAction(action, notification)); NOTIFICATION_LIST.addLast(notification); notification.notify(null); }
static void showTip(KeyPromoterAction action, int count) { String message = KeyPromoterBundle.message("kp.notification.tip", action.getDescription(), count); final int maxTips = settings.getMaxNumberOfTips(); if (maxTips != 0 && NOTIFICATION_LIST.size() >= maxTips) { final Notification notification = NOTIFICATION_LIST.removeFirst(); notification.expire(); } final Notification notification = GROUP.createNotification(KeyPromoterBundle.message( "kp.notification.group"), message, NotificationType.INFORMATION, null).setIcon(KeyPromoterIcons.KP_ICON) .addAction(new EditKeymapAction(action, action.getShortcut())); notification.addAction(new SuppressTipAction(action, notification)); NOTIFICATION_LIST.addLast(notification); notification.notify(null); }
updateNotification.expire();