Search in sources :

Example 81 with Notification

use of com.intellij.notification.Notification in project intellij-community by JetBrains.

the class CreateDesktopEntryAction method reportFailure.

public static void reportFailure(@NotNull Exception e, @Nullable final Project project) {
    LOG.warn(e);
    final String message = ExceptionUtil.getNonEmptyMessage(e, "Internal error");
    Notifications.Bus.notify(new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, "Desktop Entry Creation Failed", message, NotificationType.ERROR), project);
}
Also used : Notification(com.intellij.notification.Notification)

Example 82 with Notification

use of com.intellij.notification.Notification in project intellij-community by JetBrains.

the class CreateLauncherScriptAction method reportFailure.

public static void reportFailure(@NotNull Exception e, @Nullable final Project project) {
    LOG.warn(e);
    final String message = ExceptionUtil.getNonEmptyMessage(e, "Internal error");
    Notifications.Bus.notify(new Notification(Notifications.SYSTEM_MESSAGES_GROUP_ID, "Launcher Script Creation Failed", message, NotificationType.ERROR), project);
}
Also used : Notification(com.intellij.notification.Notification)

Example 83 with Notification

use of com.intellij.notification.Notification in project intellij-community by JetBrains.

the class CloudNotifier method showMessage.

public Notification showMessage(String message, MessageType messageType, @Nullable NotificationListener listener) {
    NotificationGroup notificationGroup = findOrCreateBaloonGroup(myNotificationDisplayId);
    Notification notification = notificationGroup.createNotification("", message, messageType.toNotificationType(), listener);
    notification.notify(null);
    return notification;
}
Also used : NotificationGroup(com.intellij.notification.NotificationGroup) Notification(com.intellij.notification.Notification)

Example 84 with Notification

use of com.intellij.notification.Notification in project intellij-community by JetBrains.

the class IdeNotificationArea method updateStatus.

private void updateStatus() {
    final Project project = getProject();
    ArrayList<Notification> notifications = EventLog.getLogModel(project).getNotifications();
    applyIconToStatusAndToolWindow(project, createIconWithNotificationCount(notifications));
    int count = notifications.size();
    setToolTipText(count > 0 ? String.format("%s notification%s pending", count, count == 1 ? "" : "s") : "No new notifications");
    myStatusBar.updateWidget(ID());
}
Also used : Project(com.intellij.openapi.project.Project) Notification(com.intellij.notification.Notification)

Example 85 with Notification

use of com.intellij.notification.Notification in project intellij-community by JetBrains.

the class PluginManagerMain method notifyPluginsUpdated.

public static void notifyPluginsUpdated(@Nullable Project project) {
    final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
    String title = IdeBundle.message("update.notifications.title");
    String action = IdeBundle.message(app.isRestartCapable() ? "ide.restart.action" : "ide.shutdown.action");
    String message = IdeBundle.message("ide.restart.required.notification", action, ApplicationNamesInfo.getInstance().getFullProductName());
    NotificationListener listener = new NotificationListener() {

        @Override
        public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
            notification.expire();
            app.restart(true);
        }
    };
    UpdateChecker.NOTIFICATIONS.createNotification(title, XmlStringUtil.wrapInHtml(message), NotificationType.INFORMATION, listener).notify(project);
}
Also used : HTMLFrameHyperlinkEvent(javax.swing.text.html.HTMLFrameHyperlinkEvent) ApplicationEx(com.intellij.openapi.application.ex.ApplicationEx) NotNull(org.jetbrains.annotations.NotNull) Notification(com.intellij.notification.Notification) NotificationListener(com.intellij.notification.NotificationListener)

Aggregations

Notification (com.intellij.notification.Notification)114 HyperlinkEvent (javax.swing.event.HyperlinkEvent)34 NotNull (org.jetbrains.annotations.NotNull)34 NotificationListener (com.intellij.notification.NotificationListener)33 Project (com.intellij.openapi.project.Project)20 VirtualFile (com.intellij.openapi.vfs.VirtualFile)11 File (java.io.File)11 IOException (java.io.IOException)11 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)8 Nullable (org.jetbrains.annotations.Nullable)8 Task (com.intellij.openapi.progress.Task)7 Module (com.intellij.openapi.module.Module)6 ExecutionException (com.intellij.execution.ExecutionException)4 NotificationAction (com.intellij.notification.NotificationAction)4 NotificationType (com.intellij.notification.NotificationType)4 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)4 Application (com.intellij.openapi.application.Application)3 Library (com.intellij.openapi.roots.libraries.Library)3 ActionCallback (com.intellij.openapi.util.ActionCallback)3 ArrayList (java.util.ArrayList)3