How to create a panel (something like the Inspection Results)

Hello,

I want to create a panel for my plugin, something like the Inspection Results. Is there a tutorial or an example how to create something like this? I also need the TreeView and Buttons as show in the Inspections Results.

regards

Chris

0

Thank you, that is a good start. But how can I control the ToolWindow from my Action.

I want to hide the ToolWindow first and when a click the Button of my Plugin the ToolWindow should be displayed.

How can I do this?

0
Avatar
Permanently deleted user

You can register your tool window in plugin.xml like this:

    <toolWindow id="ID" anchor="right" secondary="false" icon="..."
                factoryClass="path.to.YourToolWindowFactory"
                conditionClass="path.to.YourToolWindowFactory"/>

In this case your YourToolWindowFactory is responsible for:

- tool window content creation

- availability for a certain kind of project (Project can be irrelevant for your plugin if it doesn't have some specific frameworks/files/modules. For this purpose your factory implements Condition<Project> but you can omit it as well as conditionClass parameter in plugin.xml)

-it can override default behavior of method shouldBeAvailable() to false and button won't be visible at the startup

Later 'when a click the Button' you just call toolWindow.show() or ToolWindowManager.getInstance(...).getToolWindow(ID).show()

0

Thanks for the reply,

but the Method ToolWindowManager.getInstance(...).getToolWindow(ID).show() requires a Runnable. But first the ID from the plugin.xml is not avaible, I get a null for the getToolWindow(ID). :(

 

 
 
 
G
M
T
 
Detect language Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bengali Bosnian Bulgarian Catalan Cebuano Chichewa Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Esperanto Estonian Filipino Finnish French Galician Georgian German Greek Gujarati Haitian Creole Hausa Hebrew Hindi Hmong Hungarian Icelandic Igbo Indonesian Irish Italian Japanese Javanese Kannada Kazakh Khmer Korean Lao Latin Latvian Lithuanian Macedonian Malagasy Malay Malayalam Maltese Maori Marathi Mongolian Myanmar (Burmese) Nepali Norwegian Persian Polish Portuguese Punjabi Romanian Russian Serbian Sesotho Sinhala Slovak Slovenian Somali Spanish Sundanese Swahili Swedish Tajik Tamil Telugu Thai Turkish Ukrainian Urdu Uzbek Vietnamese Welsh Yiddish Yoruba Zulu   Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bengali Bosnian Bulgarian Catalan Cebuano Chichewa Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Esperanto Estonian Filipino Finnish French Galician Georgian German Greek Gujarati Haitian Creole Hausa Hebrew Hindi Hmong Hungarian Icelandic Igbo Indonesian Irish Italian Japanese Javanese Kannada Kazakh Khmer Korean Lao Latin Latvian Lithuanian Macedonian Malagasy Malay Malayalam Maltese Maori Marathi Mongolian Myanmar (Burmese) Nepali Norwegian Persian Polish Portuguese Punjabi Romanian Russian Serbian Sesotho Sinhala Slovak Slovenian Somali Spanish Sundanese Swahili Swedish Tajik Tamil Telugu Thai Turkish Ukrainian Urdu Uzbek Vietnamese Welsh Yiddish Yoruba Zulu          
 
 
 
Text-to-speech function is limited to 200 characters
 
  Options : History : Feedback : Donate Close
0

Ok I solved this myself. If the Condition returns false in the value() Method I get a null if I try to get the ToolWindow with getToolWindow(ID). First I thought the value method in the Condition is responsible if the Toolwindow is visible or not.

0

请先登录再写评论。