Icon in tabs

Hello,

I want to add an Icon to my plugin tabs.

I'm using the following API to create the content:

ContentManager contentManager = toolWindow.getContentManager();
ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(<my JComponent>, <tab-name>, false);
content.setIcon(IconLoader.getIcon(<path-to-icon>)); // Does nothing. Why?
contentManager.addContent(content); // This add the tab

The problem is: The new tab created without the icon.

Is there a way to add icons to tab, using this API?

Thanks!

0
2 comments

You need to add

content.putUserData(ToolWindow.SHOW_CONTENT_ICON, Boolean.TRUE);
1
Avatar
Permanently deleted user

Thank you!

0

Please sign in to leave a comment.