popup menu with left and right aligned items


I'm using JBPopupFactory to create a popup menu.
For a specific menu, I'd like to provide two pieces of information per menu
item.

For example, the code completion popup menu presents:
-variable name (left aligned)
-variable type (right aligned)

I want to have something similar, but in a popup menu. Is it possible/available?

Taras


4 comments
Comment actions Permalink

Hello Taras,

I'm using JBPopupFactory to create a popup menu.
For a specific menu, I'd like to provide two pieces of information per
menu item.
For example, the code completion popup menu presents:
-variable name (left aligned)
-variable type (right aligned)
I want to have something similar, but in a popup menu. Is it
possible/available?


If I understand correctly, you can use PopupChooserBuilder and pass to it
a JList with a custom renderer as the base component.

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


0
Comment actions Permalink

Hello Dmitry,

Thanks, that's what I was looking for.

Another small UI question:
I'm using UIHelper#installListSpeedSearch(), which works great. However,
for popups, ActionSelectionAid#SPEEDSEARCH also works as a filter.
Is there perhaps some way to get similar SpeedSearch filtering for a JList?

Thanks,

Taras


0
Comment actions Permalink

To put it in a different way:

-JBPopupFactory#createListPopupBuilder() allows customization of rendering
-JBPopupFactory#createActionGroupPopup() provides filtering SpeedSearch

I want to have both features in a popup menu.


0

Please sign in to leave a comment.