use of com.intellij.application.options.ModuleListCellRenderer in project intellij-community by JetBrains.
the class AddModuleDependencyFix method invoke.
@Override
public void invoke(@NotNull Project project, @Nullable Editor editor, PsiFile file) {
if (myModules.size() == 1) {
addDependencyOnModule(project, editor, ContainerUtil.getFirstItem(myModules));
} else {
JBList<Module> list = new JBList<>(myModules);
list.setCellRenderer(new ModuleListCellRenderer());
JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list).setTitle(QuickFixBundle.message("orderEntry.fix.choose.module.to.add.dependency.on")).setMovable(false).setResizable(false).setRequestFocus(true).setItemChoosenCallback(() -> addDependencyOnModule(project, editor, list.getSelectedValue())).createPopup();
if (editor != null) {
popup.showInBestPositionFor(editor);
} else {
popup.showCenteredInCurrentWindow(project);
}
}
}
Aggregations