Combobox in toolbar

Hello,

Is there a standard way to create a combobox in toolbar (like one in the project tool window or run/debug configs in main toolbar)? I've looked through an open API and samples, but can't find anything useful :(

6 comments
Comment actions Permalink

Yes, you can
Create ActionGroup (DefaultActionGroup)
Add your actions to group then call method
ActionManager.createActionPopupMenu("place_id", yourGroup);

Good luck!

BTW, you can also look here:
http://www.intellij.org/twiki/bin/view/Main/PluginDocumentation#Actions_in_a_ToolWindow_font_b_

--
Alexey Efimov, Software Engineer
Sputnik Labs,
http://www.spklabs.com
"Alexander Kitaev" <no_mail@jetbrains.com> wrote in message
news:7679183.1062537033634.JavaMail.itn@is.intellij.net...

Hello,

>

Is there a standard way to create a combobox in toolbar (like one in the

project tool window or run/debug configs in main toolbar)? I've looked
through an open API and samples, but can't find anything useful :(


0
Comment actions Permalink

Hello Alexey,

Unfortunately, is is still not clear for me how to create combobox (drop down control) in my tool window toolbar, that will look exactly like drop down list of run/debug configurations in the main toolbar without writing my own component.

It is pretty clear how to create toolbar or popup menu component, but I can't find a simple way to put the popup menu control in toolbar so that it will work and look the same way as mentioned above drop down list in the main toolbar. I think there should be a straight simple way to do this, but i couldn't find it :(

0
Comment actions Permalink

Ah, sounds like you need an ActionGroup Wrapper. I work a lot with those things.
You create a DefaultActionGroup that wraps the run/debug combo and replace it in
the toolbar. I'll try to remember when I return to work tomorrow to get an
example of how it MIGHT work.

Alexander Kitaev wrote:

Hello Alexey,

Unfortunately, is is still not clear for me how to create combobox (drop down control) in my tool window toolbar, that will look exactly like drop down list of run/debug configurations in the main toolbar without writing my own component.

It is pretty clear how to create toolbar or popup menu component, but I can't find a simple way to put the popup menu control in toolbar so that it will work and look the same way as mentioned above drop down list in the main toolbar. I think there should be a straight simple way to do this, but i couldn't find it :(


--

Erb

==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================

0
Comment actions Permalink

Hello,

That solution doesn't completely meet my needs because I need a combo with my own contents, but that will look just exactly the same as run/debug combo, not just a copy of run/debug component.

Finally, I've managed to write such a component myself :) I'm new to IDEA, and I have noted, that while it is extremely good for writing code, it sometimes requires a lot of work for plugin developer to provide UI consistent with IDEA L&F (comparing with Eclipse).

0
Comment actions Permalink

Alexander Kitaev wrote:

Hello,

Is there a standard way to create a combobox in toolbar (like one in the project tool window or run/debug configs in main toolbar)? I've looked through an open API and samples, but can't find anything useful :(


Currently there is no way to have combo box or any other JComponent
inside IDEA toolbar. We have internal API to do this but this API is not
clean yet to be public. Actually we want to open this part of API and
most probable we'll do it inside Aurora schedule. Please submit a
feature request into the tracker.

Best regards,
Vladimir Kondratyev
_____________________
JetBrains

0

Please sign in to leave a comment.