How to link the two tabs of the plugin


When developing the plug-in, I encountered some problems. My plug-in has a tool window, and the tool window has two pages. I want to make a common toolbar for them, similar to the toolbar of maven. If I am on the first page After some operations are performed on the toolbar, it will have corresponding display effects. For example, after I click the icon, the icon will be grayed out, but it will only be grayed out on this page. I have no good way to make it on another page. Sync greyed out, hope to get help, thanks a lot。


开发插件的时候,遇到了一些问题,我这个插件有一个工具窗口,工具窗口有两个页面,我想为他们做一个公用工具栏,类似于maven那样的工具栏,假如我在第一个页面的工具栏进行了一些操作,他会有相应的显示效果,比如说我点击图标后,图标会变灰,但是它只会在此页面变灰, 我没有好的办法能让它在另外一个页面同步变灰,希望得到帮助,非常感谢


1 comment

I suggest creating an application- or project-level service that will hold your toolbar selections and synchronize them in tabs when a tab is selected. You can listen to the selection event with: com.intellij.ui.content.ContentManagerListener#selectionChanged.


Please sign in to leave a comment.