ToolWindowmanager registerToolWindow depricated

I noticed that one of the registerToolWindow methods has been depricated in the latest version of IDEA. If I am to follow the new version there is no way of passing in the JComponent anymore.
It seems that I am supposed to use a ContentManager and put Content objects into that somehow.

Can anyone please explain what these Content objects are and what I am supposed to do?

Comment actions Permalink

I haven't tried it, but I suppose something like this should work:

ToolWindow tw = twm.registerToolWindow(...);
PeerFactory pf = com.intellij.peer.PeerFactory.getInstance();

Content content = pf.getContentFactory().createContent(jcomponent, "Title", false);


Comment actions Permalink

Thanks alot, Ill give that a try on monday.

Comment actions Permalink

Yup, it works.
Here is a full code sample if anyone else needs to make tool windows.

ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
ToolWindow toolWindow = toolWindowManager.registerToolWindow("BiPad", true, ToolWindowAnchor.BOTTOM);
PeerFactory pf = com.intellij.peer.PeerFactory.getInstance();
Content content = pf.getContentFactory().createContent(biPadForm.getMasterPanel(), "", false); // first arg is a JPanel
toolWindow.setIcon(IconLoader.getIcon("Bindows-Logo-12.png", BindowsApplicationComponent.class));


Please sign in to leave a comment.