简体   繁体   English

在 IntelliJ 中显示或打开我的插件

[英]Show or open my plugin in IntelliJ

I'm developing a plugin for IntelliJ and the default state of the plugin is hide (like the others plugins - Maven Projects, Ant Build etc...)我正在为 IntelliJ 开发一个插件,插件的默认状态是隐藏(就像其他插件一样 - Maven 项目、Ant Build 等......)

My plugin uses the package com.intellij.openapi.ui.popup.BalloonBuilder to show a balloon on part of classes with some logic.我的插件使用 com.intellij.openapi.ui.popup.BalloonBuilder 包在具有某些逻辑的部分类上显示气球。

Now I want to add the functionality to show or open the plugin:现在我想添加显示或打开插件的功能:

        builder.setClickHandler(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {
                // Show or open the plugin
            }
        }, true);

How I do it?我怎么做?

The solution is call to show method on ToolWindow object:解决方法是在 ToolWindow 对象上调用 show 方法:

ToolWindow toolWindow = toolWindowManager.registerToolWindow("MyPlugin", myPanel, ToolWindowAnchor.RIGHT);

builder.setClickHandler(new ActionListener() {
    @Override
        public void actionPerformed(ActionEvent e) {
            toolWindow.show(new Runnable() {
                    @Override
                        public void run() {
                            System.out.print("Showing the plugin!");
                        }
                });
        }
}, true);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在IntelliJ IDEA插件DevKit中显示我的动作中的ColorPicker? - How to show ColorPicker from my action in IntelliJ IDEA plugin DevKit? 运行服务器时,我的插件没有出现在我的世界(Intellij)中 - When running the server, my plugin does not show up in minecraft (Intellij) 如何在intellij IDEA中打开或调用regexTester插件 - How to open or invoke the regexTester plugin in intellij IDEA 插件开发之外的IntelliJ Open API使用 - IntelliJ Open API usage outside of plugin development 为什么我的IntelliJ插件未在Android Studio中显示 - Why my IntelliJ plugin not showing in Android Studio Intellij插件创建后在编辑器中打开新类 - Intellij plugin open new class in editor after creation 在我的插件中添加特定的代码路径以支持多个IntelliJ版本 - Add a specific code path in my plugin to support multiple IntelliJ version Intellij无法打开我的JDK所在的文件夹 - Intellij can't open the folder where my JDK is located 如何仅使用INTELLIJ中的文件名打开src目录中的文件 - How to open a file in my src directory using just the filename in INTELLIJ 使用 IntelliJ 2019.3.1 为 Clion 开发插件。 如何为我的插件项目添加 C++ 语言支持? - Using IntelliJ 2019.3.1 for plugin development for Clion. How to add c++ language support for my plugin project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM