Console output toolwindow with toolbar on the left

I create a toolwindow with console output using the following code:





ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(view.getComponent(), "", false);

 
 

 

toolWindow.getContentManager().addContent(content);

 

toolWindow.setIcon(....);

 

 

 

toolWindow.show(
new Runnable() {
public void run() {
System.out.println("Do something here");
}
});


toolWindow = manager.registerToolWindow(id, true, ToolWindowAnchor.BOTTOM);


(1) Is this a correct way to do this?

(2) I want to enhance the window, so to add a toolbar with some actions on the left (like in other toolwindows). How to do this when having console output - i.e. how to wrap console in some jpanel?
thank you!

0
1 comment

Hello Igor,

Yes, this is generally correct. There is no special trick for wrapping a
console into a panel - simply create a panel, add the console.getComponent()
to it along with some other components, and add the resulting panel as a
content to the content manager.

I create a toolwindow with console output using the following code:

ContentFactory contentFactory = ContentFactory.SERVICE.getInstance();
Content content = contentFactory.createContent(view.getComponent(),
"", false);
toolWindow.getContentManager().addContent(content);
toolWindow.setIcon(....);
toolWindow.show(
new Runnable() {
public void run() {
System.out.println("Do something here");
}
});
toolWindow = manager.registerToolWindow(id, true,
ToolWindowAnchor.BOTTOM);

(1) Is this a correct way to do this?

(2) I want to enhance the window, so to add a toolbar with some
actions on the left (like in other toolwindows). How to do this when
having console output - i.e. how to wrap console in some jpanel?


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


0

Please sign in to leave a comment.