Create a plugin with a i18ln title Follow
Answered
Hi,
I'm devolping a plugin for Intellij and this plugin start hidden in the bottom bar (only shows the plugin title/id and icon).
How can i show this title/id in a multi-language when is hidden?
Thanks!
Please sign in to leave a comment.
You can override ToolWindowFactory#init and set title there.
By the way you're mixing up 'tool window' and 'plugin' concepts. 'Tool Window' is just an additional component shown in the IDE main screen, but a plugin is the whole bunch of functionality provided by your code. A plugin may show several tool windows or don't show tool windows at all. Note that you need to provide a tool window only if it shows some information which users may want to see simultaneously with editing their sources. If you want to provide a way to invoke some tool, you may add an action to the main menu which shows a dialog allowing a user to setup parameter and invoke the tool when user clicks ok. This way you'll save space on the main screen, users will be able to invoke the tool via shortcut by assigning it to the action, etc.
What do you mean by 'plugin title' and 'the bottom bar'? Could you please attach a screenshot?
When the Intellij loads the plugins is hidden like this
So here we have the icon and the tiltle defined in the plugin.xml
I want this translated. I know I can change and change the text to a translated text in the ToolWindowFactory using toolWindow.setTitle and toolWindow.setStripeTitle, but this will only be executed after opening the plugin (press that "CheckTool").
This plugin opens a toolwindow with a table. That's why I'm using an extensionPoint with a toolwindow.
Can you give me an example of how can I override that? I cannot find the init method to override!
Thank you for the help!
It's in ToolWindowFactory interface.
Thank you Nikolay.
Now I understand, but the problem is I'm still on Intellij 2015. Is there a way to do this for this version?
Regards
You can register an ApplicationComponent and write in its initComponent's implementation (which is called when IDE starts) code which calls ToolWindowManager#getToolWindow method to get instance ToolWindow and calls setTitle on it.
I did try that but ToolWindowManager#getInstance needs the Project and by that time I don't have any open projects. So how can I get the ToolWindowManager?
I found the solution for this.
Instead of using the ApplicationComponent, I used the ProjectComponent and in the startup I'm creating the toolwindow myself (instead of having the Extension point creating)
Yes, you're right, ProjectComponent should help here.