Make ListPopup scrollable

I have a Listpop created as:

ListPopup st = JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<PsiFile>("Choose implementation class", javaFiles) {

....
}

How can I make the popup list scrollable so that i can limit the number of items in it?

0
12 comments

By default, a list popup shows up to 20 items, and shows a scrollbar if it has more items. If you want to have a different row count, you can override this by creating a ListPopupImpl directly and passing the row count parameter to the constructor.

0
Avatar
Permanently deleted user

Thank you, ill try that.

My intellij plugin has a keyboard shortcut which is defined in plugin.xml and this shortcut works fine when I launch intellij during development. But it doesnt work when i install this plugin and create a new project.
Plugin.xml has :

 
<actions>
    <action id="abc.Format"
            class="com.xyz.abc.formatter.SpecFormatter"
            text="spec format" description="Format spec files">
    <keyboard-shortcut first-keystroke="ctrl alt shift f" keymap="$default"/>
    </action>
</actions>


Let me know what would be the changes to be done.

Thankyou for the reply.

0

How exactly do you package your plugin before you install it?

0
Avatar
Permanently deleted user

Im just doin : Build -> Prepare plugin module for Deployment. This gives me a zip file which im using to install the plugin.

Let me know if this is not the expected way.

0

If you open Settings | Plugins after you install the plugin, do you see it there? Is it enabled?


0
Avatar
Permanently deleted user

Ya. The plugin is enabled. And all the other features i did in plugin are reflected. But only this shortcut isnt working.
I even made sure that keymap is set to Default.

0

If you run IntelliJ IDEA with you plugin installed, open Settings | Keymap, press the "Find Actions by Shortcut" button (http://screencast.com/t/eIgeOZcVx0) and press your shortcut, what happens?

0
Avatar
Permanently deleted user

It shows the file properly when i do this, go fmt file is the action i need to perform. But this doesn happen when I press this shortcut.

Attached the screenshot of "Find actions by shortcut".



Attachment(s):
Screen Shot 2014-12-15 at 10.23.09 AM.png
0

The screenshot shows that you have multiple actions assigned to the same shortcut. Most likely the shortcut is intercepted by the Gauge plugin. Please try unassigning the shortcut from the "spec format" action.

0
Avatar
Permanently deleted user

If i unassign the Go plugin shortcut, the Gauge shortcut works fine.

You told to unassign the "spec format" shortcut which itself is the desired shortcut of my plugin. Is there a way to override the already existing shortcut?

0

A properly implemented action disables itself in the context where it's not applicable (for example, the "go fmt" action probably makes sense only when a Go file is open in the editor).

If the action of another plugin is not propertly implemented, there's not much that you can do to override it, other than sending a pull request to fix the other plugin.

0
Avatar
Permanently deleted user

My plugin's core is implemented in the goLang and may be hence it shows the context of "go fmt" tools from go plugin.

Choosing a shortcut which isnt chosen in Intellij IDE and golang would work. I tried it. And, i hope this doesn affect the shortcuts of any other plugin because they dont belong to this context. Guess this fixes the issue.

Thank you.

0

Please sign in to leave a comment.