IDEA start - event when main window becomes visible

Hi,

I want to add icon to IDEA status bar (writing plugin) but I faced several problems.
Few questions:
- how to get event when main window becomes visible, just after IDEA start? This is necessary to get reference to the main IDEA window and its status bar. I assume that no project is open. I cannot do that in +initComponent +of the +ApplicationComponent +class as the IDEA window is not yet visible there. Till now I'm using some workaround with timer which is of course ugly solution.
- when opening project the status bar is 'reloaded' and Icon added before project was open dissappears. How to avoid that? Is there a way to put something to the status bar permanently? I use WindowManager.getInstance().getAllFrames()[0].getStatusBar in Application Component and WindowManager.getInstance().getStatusBar(project) in project component.

2 comments
Comment actions Permalink

Hello Jacek,

The correct time to add a status bar component is from the projectOpened()
method of a project component. There is no way to put something in the status
bar "permantently" because the status bar is recreated for every opened project.

I want to add icon to IDEA status bar (writing plugin) but I faced
several problems.

Few questions:

- how to get event when main window becomes visible, just after IDEA
start? This is necessary to get reference to the main IDEA window and
its status bar. I assume that no project is open. I cannot do that in
+initComponent +of the +ApplicationComponent +class as the
IDEA window is not yet visible there. Till now I'm using some
workaround with timer which is of course ugly solution.

- when opening project the status bar is 'reloaded' and Icon added
before project was open dissappears. How to avoid that? Is there a way
to put something to the status bar permanently? I use
WindowManager.getInstance().getAllFrames()[0].getStatusBar in
Application Component and
WindowManager.getInstance().getStatusBar(project) in project
component.

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


0
Comment actions Permalink

Thanks. I suspected that.

0

Please sign in to leave a comment.