创建项目
- 创建InjelliJ Platform Plugin
- 修改信息
- 创建action
- 编写代码
package com.yuanshuai.tool.idea;
import com.intellij.notification.*;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
public class HelloAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent e) {
NotificationGroup notificationGroup = new NotificationGroup("hello", NotificationDisplayType.BALLOON, true);
Notification notification = notificationGroup.createNotification("hello", NotificationType.ERROR);
Notifications.Bus.notify(notification);
}
}
- 运行测试