Figured out how to show one of those little notification bubble messages in the top right of the screen, answer below.
Navigate to detected problems in the widget or by pressing F2 or Shift+F2 accordingly. By default, the IDE will navigate you to problems according to their severity: errors > warnings > weak warnings > server problems > typos. , select 'Next Error' Action (F2) Goes Through, and enable All Problems.
You can configure the IDE to show inferred annotations right in your code. Press Ctrl+Alt+S to open the IDE settings and select Editor | Inlay Hints | Annotations | Java. Select the Inferred annotations checkbox.
In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Appearance & Behavior | Appearance. Select the UI theme from the Theme list: IntelliJ Light: Traditional light theme for IntelliJ-based IDEs.
Last modified: 26 September 2022. Product Help: Status bar. The IntelliJ Platform allows plugins to extend the IDE status bar with additional custom widgets. Status bar widgets are small UI elements that allow providing users with useful information and settings for the current file, project, IDE, etc.
Turns out, you have to make a NotificationGroup instance, and then use that to make a Notification, and pass the notification and the Project to Notifications.Bus.notify().
public class VoiceApplicationComponentImpl implements ApplicationComponent, VoiceApplicationComponent {
...
public static final NotificationGroup GROUP_DISPLAY_ID_INFO =
new NotificationGroup("My notification group",
NotificationDisplayType.BALLOON, true);
...
void showMyMessage(String message) {
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
Notification notification = GROUP_DISPLAY_ID_INFO.createNotification(message, NotificationType.ERROR);
Project[] projects = ProjectManager.getInstance().getOpenProjects();
Notifications.Bus.notify(notification, projects[0]);
}
});
}
Note: you'll probably have a better way to get the current Project, right now I just assume there's one open project. This means my method doesn't work on startup (projects array is empty).
Another note: you'll probably not need to wrap with the invokeLater but I did, because I was calling showMyMessage in a different thread.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With