void (@NotNull DefaultActionGroup group, @NotNull List<? extends ListPluginComponent> selection) { if (!myIsAvailable) { return; } if (myOnlyUpdateMode) { return; } for (ListPluginComponent component : selection) { if (MyPluginModel.isInstallingOrUpdate(component.myPlugin) || component.myAfterUpdate) { return; } } boolean restart = true; for (ListPluginComponent component : selection) { if (component.myRestartButton == null) { restart = false; break; } } if (restart) { group.add(new ButtonAnAction(selection.get(0).myRestartButton)); return; } int size = selection.size(); boolean getDescriptorFunction = true; if (myMarketplace) { JButton[] installButtons = new JButton[size]; int installCount = 0; int installedCount = 0; for (int i = 0; i < size; i++) { ListPluginComponent component = selection.get(i); JButton button = component.myInstallButton; if (button != null && button.isVisible() && button.isEnabled()) { installButtons[i] = button; installCount++; } else if (component.myInstalledDescriptorForMarketplace != null) { installedCount++; } else { return; } } if (installCount == size) { group.add(new ButtonAnAction(installButtons)); return; } if (installedCount != size) { return; } getDescriptorFunction = false; } JButton[] updateButtons = new JButton[size]; for (int i = 0; i < size; i++) { JButton button = selection.get(i).myUpdateButton; if (button == null || !button.isVisible() || !button.isEnabled()) { updateButtons = null; break; } updateButtons[i] = button; } if (updateButtons != null) { group.add(new ButtonAnAction(updateButtons)); if (size > 1) { return; } } Function<ListPluginComponent, IdeaPluginDescriptor> function = getDescriptorFunction ? ListPluginComponent::getPluginDescriptor : ListPluginComponent::getInstalledDescriptorForMarketplace; SelectionBasedPluginModelAction.addActionsTo(group, action -> createEnableDisableAction(action, selection, function), () -> createUninstallAction(selection, function)); }