-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1dd422b
commit 8586505
Showing
6 changed files
with
61 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 11 additions & 13 deletions
24
src/main/java/org/rookie/plugins/utils/IntellijNotifyUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,27 @@ | ||
package org.rookie.plugins.utils; | ||
|
||
import com.intellij.notification.NotificationDisplayType; | ||
import com.intellij.notification.NotificationGroup; | ||
import com.intellij.notification.NotificationGroupManager; | ||
import com.intellij.notification.NotificationType; | ||
import com.intellij.openapi.project.Project; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class IntellijNotifyUtil { | ||
|
||
private static final NotificationGroup NOTIFICATION_GROUP = | ||
new NotificationGroup("BeanMappingKeyNotification", | ||
NotificationDisplayType.BALLOON, true); | ||
private NotificationGroup getNotificationGroup() { | ||
return NotificationGroupManager.getInstance() | ||
.getNotificationGroup("BeanMappingKeyNotification"); | ||
} | ||
|
||
public static void notifyError(@Nullable Project project, String content) { | ||
// 2020.3 before | ||
NOTIFICATION_GROUP.createNotification(content, NotificationType.ERROR).notify(project); | ||
public void notifyError(@Nullable Project project, String content) { | ||
getNotificationGroup().createNotification(content, NotificationType.ERROR).notify(project); | ||
} | ||
|
||
public static void notifyWarning(@Nullable Project project, String content) { | ||
// 2020.3 before | ||
NOTIFICATION_GROUP.createNotification(content, NotificationType.WARNING).notify(project); | ||
public void notifyWarning(@Nullable Project project, String content) { | ||
getNotificationGroup().createNotification(content, NotificationType.WARNING).notify(project); | ||
} | ||
|
||
public static void notifyInfo(@Nullable Project project, String content) { | ||
// 2020.3 before | ||
NOTIFICATION_GROUP.createNotification(content, NotificationType.INFORMATION).notify(project); | ||
public void notifyInfo(@Nullable Project project, String content) { | ||
getNotificationGroup().createNotification(content, NotificationType.INFORMATION).notify(project); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<idea-plugin> | ||
<idea-plugin require-restart="false"> | ||
<id>org.rookie.plugins.BeanMappingKey</id> | ||
<name>BeanMappingKey</name> | ||
<vendor email="[email protected]" url="https://github.com/rookie-ricardo">Rookie</vendor> | ||
|
@@ -26,7 +26,9 @@ | |
<depends>com.intellij.modules.java</depends> | ||
|
||
<extensions defaultExtensionNs="com.intellij"> | ||
<!-- Add your extensions here --> | ||
<notificationGroup id="BeanMappingKeyNotification" | ||
displayType="BALLOON" | ||
key="notification.group.name"/> | ||
</extensions> | ||
|
||
<actions> | ||
|
@@ -40,7 +42,4 @@ | |
<keyboard-shortcut keymap="Mac OS X 10.5+" first-keystroke="ctrl alt M"/> | ||
</action> | ||
</actions> | ||
|
||
<idea-version since-build="201"/> | ||
|
||
</idea-plugin> |