Combobox with Browse-Button and Autocompletion?

Hi,

I found com.intellij.ui.ComboboxWithBrowseButton, but I would also like to enable autocompletion like it's available in "Copy..." for classes. What component is it? Is it available for plugin developers?

Cheers,
Robert

6 comments

That is not part of the openapi, but I sneakily use it in my Lineage plugin anyway. You need to include idea.jar into your "IntelliJ IDEA SDK", to use it. Here is the relevant code snippet:


The Arguments:
The ActionPerformer handles the action when the user clicks on the browse button
"initialPackage.getQualifiedName()" is the initial value of the text field.
"manager" is a PsiManager
the boolean specifies if this is a field for completing packages (false) or fully qualified class names (true)
The String is a key for storing recently used values (dropdown).

Bas

0

Hi Bas,

Thanks, now I know what IDEA uses internally, but it won't help in my situation since I'm neither autocompleting classes nor packages. I hoped for some generic component into which I could plug some autocompletion action that would return a list of matching results.
In my plugin I'm searching for a possibility to autocomplete folder paths. You type in something like "c:/somefolder/ot" press CTRL+Space and get a list of all folders in "c:/somefolder/" which names start with "ot".
Well, I think I'll implement it myself. Can anyone tell me how to create an autocompletion-popup (a popup that looks like those other autocompletion popups)?

Cheers,
Robert

0

Hello Robert,

see http://www.jetbrains.net/confluence/display/IDEADEV/EAP7002Release+Notes

There's also some OpenAPI for it:
com.intellij.openapi.fileChooser.FileChooserFactory#createFileTextField

Sascha

Robert F. Beeger wrote:

Hi Bas,

Thanks, now I know what IDEA uses internally, but it won't help in my situation since I'm neither autocompleting classes nor packages. I hoped for some generic component into which I could plug some autocompletion action that would return a list of matching results.
In my plugin I'm searching for a possibility to autocomplete folder paths. You type in something like "c:/somefolder/ot" press CTRL+Space and get a list of all folders in "c:/somefolder/" which names start with "ot".
Well, I think I'll implement it myself. Can anyone tell me how to create an autocompletion-popup (a popup that looks like those other autocompletion popups)?

Cheers,
Robert

0

Hi Sascha,

Thanks for pointing this out.
Well, it won't work for me, since I need a combobox with those capabilities.

I wonder whether it's a coincidence that it was included in IDEA now or whether they took my implementation of this feature in the FileBrowser plugin as an inspiration. ;)

Cheers,
Robert

0

Hello Robert,

Well, it won't work for me, since I need a combobox with those capabilities.


What's stopping you from using com.intellij.openapi.fileChooser.FileTextField#getField as
a combobox editor?

Sascha

0

Oh well, nothing. Thanks.

Cheers,
Robert

0

Please sign in to leave a comment.