com.intellij.notification.NotificationAction Java Examples

The following examples show how to use com.intellij.notification.NotificationAction. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: LatteIndexUtil.java    From intellij-latte with MIT License 6 votes vote down vote up
private static void showWaring(Project[] projects) {
    if (projects.length == 0) {
        return;
    }

    LatteIdeHelper.doNotify(
            "Latte plugin warning",
            "Latte files can not be reparsed during indexing. Wait after all processes around indexing will be done.",
            NotificationType.ERROR,
            projects[0],
            new NotificationAction("Refresh Configuration") {
                @Override
                public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification notification) {
                    tryPerform(projects, notification);
                }
            }
    );
}
 
Example #2
Source File: LatteIdeHelper.java    From intellij-latte with MIT License 6 votes vote down vote up
public static Notification doNotify(
        @NotNull String title,
        @NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String content,
        @NotNull NotificationType type,
        @Nullable Project project,
        boolean important,
        @Nullable NotificationAction notificationAction
) {
    Notification notification = new Notification(NOTIFICATION_GROUP, title, content, type);
    notification.setImportant(important);
    if (notificationAction != null) {
        notification.addAction(notificationAction);
    }
    doNotify(notification, project);
    return notification;
}
 
Example #3
Source File: LatteIndexUtil.java    From intellij-latte with MIT License 5 votes vote down vote up
public static void notifyRemovedFiles(List<Project> projects) {
    LatteIdeHelper.doNotify(
            "Latte plugin settings",
            "File latte-intellij.xml was removed. You can refresh configurations.",
            NotificationType.INFORMATION,
            null,
            new NotificationAction("Refresh Configuration") {
                @Override
                public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification notification) {
                    tryPerform(projects.toArray(new Project[0]), notification);
                }
            }
    );
}
 
Example #4
Source File: LatteIndexUtil.java    From intellij-latte with MIT License 5 votes vote down vote up
public static Notification notifyReparseFiles(Project project) {
    return LatteIdeHelper.doNotify(
            "Latte configuration reloaded",
            "Latte plugin detected latte-intellij.xml file. Latte files need reparse.",
            NotificationType.WARNING,
            project,
            true,
            new NotificationAction("Reparse Latte Files") {
                @Override
                public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification current) {
                    tryPerform(new Project[]{project}, current);
                }
            }
    );
}
 
Example #5
Source File: LatteIndexUtil.java    From intellij-latte with MIT License 5 votes vote down vote up
public static Notification notifyDefaultReparse(Project project) {
    return LatteIdeHelper.doNotify(
            "Latte configuration reloaded",
            "Latte plugin installed configuration files to your .idea folder. It needs reparse files. (this should only happen if the first installation of new plugin version)",
            NotificationType.WARNING,
            project,
            true,
            new NotificationAction("Reparse Latte Files") {
                @Override
                public void actionPerformed(@NotNull AnActionEvent e, @NotNull Notification current) {
                    tryPerformReadLock(new Project[]{project}, current);
                }
            }
    );
}
 
Example #6
Source File: LatteIdeHelper.java    From intellij-latte with MIT License 5 votes vote down vote up
public static void doNotify(
        @NotNull String title,
        @NotNull @Nls(capitalization = Nls.Capitalization.Sentence) String content,
        @NotNull NotificationType type,
        @Nullable Project project,
        @Nullable NotificationAction notificationAction
) {
    doNotify(title, content, type, project, false, notificationAction);
}