List of usage examples for com.intellij.openapi.ui.popup JBPopupFactory createListPopup
@NotNull public abstract ListPopup createListPopup(@NotNull ListPopupStep step);
From source file:com.mnr.java.intellij.idea.plugin.base64helper.MainActionHandler.java
License:Apache License
private ListPopup getListPopup(Editor editor) { JBPopupFactory instance = JBPopupFactory.getInstance(); ListPopupStep listPopupStep = getStep(editor); return instance.createListPopup(listPopupStep); }
From source file:org.twodividedbyzero.idea.findbugs.gui.toolwindow.view.CloudCommentsPaneIntellij.java
License:Open Source License
protected void showCloudChooser(final List<CloudPlugin> plugins, final List<String> descriptions) { final JBPopupFactory factory = JBPopupFactory.getInstance(); final ListPopup popup = factory .createListPopup(new BaseListPopupStep<String>("Store comments in:", descriptions) { @Override/*from w ww. j a v a 2 s.c o m*/ public PopupStep<?> onChosen(final String selectedValue, final boolean finalChoice) { if (selectedValue != null) { final int index = descriptions.indexOf(selectedValue); if (index == -1) { LOGGER.error("Error - not found - '" + selectedValue + "' among " + descriptions); } else { final CloudPlugin newPlugin = plugins.get(index); final String newCloudId = newPlugin.getId(); changeCloud(newCloudId); } } return super.onChosen(selectedValue, finalChoice); } @Override public void canceled() { super.canceled(); } }); popup.showInCenterOf(signInOutLink); }