Deprecated methods in openapi.jar

Hello,
I've got a problem when replacing method ToolWindowManager.registerToolWindow(@NotNull String id,@NotNull JComponent component,@NotNull ToolWindowAnchor anchor); (which is deprecated) with ToolWindowManager.registerToolWindow(@NotNull String id, boolean canCloseContent, @NotNull ToolWindowAnchor anchor);
After I've made such change in my project, my window is not registered, it doesn't work.
Has anyone had the same problem?
ToolWindowManager lays in openapi.jar in package com.intellij.opeanapi.wm

Thanks

5 comments
Comment actions Permalink

Hello ALincoln,

I've got a problem when replacing method
ToolWindowManager.registerToolWindow(@NotNull String id,@NotNull
JComponent component,@NotNull ToolWindowAnchor anchor); (which is
deprecated) with ToolWindowManager.registerToolWindow(@NotNull String
id, boolean canCloseContent, @NotNull ToolWindowAnchor anchor);

After I've made such change in my project, my window is not
registered, it doesn't work.


After you've made this change, you also need to call ToolWindow.getContentManager().addContent()
to add your component to the toolwindow.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

I'm sorry, maybe I don't understand smething but if I have:
ToolWindow window = manager.registerToolWindow(viewID, true, ToolWindowAnchor.BOTTOM);
ContentManager cm = window.getContentManager();
cm.addContent() - here I can't add a JComponent, because I need to add a JComponent toolWindow here.. addContent doesn't work with JComponent

Should I do:
ContentManager cm = window.getContentManager();
cm.getComponent().add(toolWindow);

Edited by: ALincoln on May 15, 2008 4:00 PM

0
Comment actions Permalink

Hello ALincoln,

I'm sorry, maybe I don't understand smething but if I have:

ToolWindow window = manager.registerToolWindow(viewID, true,
ToolWindowAnchor.BOTTOM);

ContentManager cm = window.getContentManager();

cm.addContent() - here I can't add a JComponent, because I need to add
a JComponent toolWindow here..


Use PeerFactory.getContentFactory().createContent() to create a Content instance
for your component.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

Should I use

instead deprecated

?

0
Comment actions Permalink

Hello Alex,

Should I use


instead
deprecated


?


Yes, in IDEA 8 this is the correct API to use. ContentFactory.SERVICE is
not available in IDEA 7.

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0

Please sign in to leave a comment.