void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (!PluginManagementPolicy.getInstance().isInstallFromDiskAllowed()) { Messages.showErrorDialog(project, IdeBundle.message("action.InstallFromDiskAction.not.allowed.description"), IdeBundle.message("action.InstallFromDiskAction.text")); return; } VirtualFile contextFile = e.getData(CommonDataKeys.VIRTUAL_FILE); VirtualFile toSelect = contextFile != null && contextFile.isInLocalFileSystem() && isPluginArchive(contextFile.getPath()) ? contextFile : getFileToSelect(PropertiesComponent.getInstance().getValue(PLUGINS_PRESELECTION_PATH)); FileChooser.chooseFile(new FileChooserDescriptorImpl(), project, myParentComponent, toSelect, virtualFile -> { File file = VfsUtilCore.virtualToIoFile(virtualFile); PropertiesComponent.getInstance().setValue(PLUGINS_PRESELECTION_PATH, FileUtilRt.toSystemIndependentName(file.getParent())); installFromDisk(file, project); }); }