import com.intellij.ui.content.ContentManager;
import com.intellij.ui.content.ContentManagerUtil;
public class SayHelloAction extends AnAction {
public void actionPerformed(AnActionEvent e) {
ContentManager contentManager = ContentManagerUtil.getContentManagerFromContext(e.getDataContext(), false);
Application application = ApplicationManager.getApplication();
HelloWorldApplicationComponent helloWorldComponent =
application.getComponent(HelloWorldApplicationComponent.class);
helloWorldComponent.sayHello();
if (contentManager != null) {
contentManager.addContent(ContentFactory.SERVICE.getInstance().createContent(helloWorldComponent.createComponent(), "POPS", false));
}
}