void (@Nullable Collection<? extends IdeaPluginDescriptor> updates) { if (ContainerUtil.isEmpty(updates)) { if (myBundledUpdateGroup.ui != null) { myInstalledPanel.removeGroup(myBundledUpdateGroup); myInstalledPanel.doLayout(); } } else if (myBundledUpdateGroup.ui == null) { for (IdeaPluginDescriptor descriptor : updates) { for (UIPluginGroup group : myInstalledPanel.getGroups()) { ListPluginComponent component = group.findComponent(descriptor); if (component != null && component.getPluginDescriptor().isBundled()) { myBundledUpdateGroup.descriptors.add(component.getPluginDescriptor()); break; } } } if (!myBundledUpdateGroup.descriptors.isEmpty()) { myInstalledPanel.addGroup(myBundledUpdateGroup, 0); myBundledUpdateGroup.ui.excluded = true; for (IdeaPluginDescriptor descriptor : updates) { ListPluginComponent component = myBundledUpdateGroup.ui.findComponent(descriptor); if (component != null) { component.setUpdateDescriptor(descriptor); } } myInstalledPanel.doLayout(); } } else { List<ListPluginComponent> toDelete = new ArrayList<>(); for (ListPluginComponent plugin : myBundledUpdateGroup.ui.plugins) { boolean exist = false; for (IdeaPluginDescriptor update : updates) { if (plugin.getPluginDescriptor().getPluginId().equals(update.getPluginId())) { exist = true; break; } } if (!exist) { toDelete.add(plugin); } } for (ListPluginComponent component : toDelete) { myInstalledPanel.removeFromGroup(myBundledUpdateGroup, component.getPluginDescriptor()); } for (IdeaPluginDescriptor update : updates) { ListPluginComponent exist = myBundledUpdateGroup.ui.findComponent(update); if (exist != null) { continue; } for (UIPluginGroup group : myInstalledPanel.getGroups()) { if (group == myBundledUpdateGroup.ui) { continue; } ListPluginComponent component = group.findComponent(update); if (component != null && component.getPluginDescriptor().isBundled()) { myInstalledPanel.addToGroup(myBundledUpdateGroup, component.getPluginDescriptor()); break; } } } if (myBundledUpdateGroup.descriptors.isEmpty()) { myInstalledPanel.removeGroup(myBundledUpdateGroup); } else { for (IdeaPluginDescriptor descriptor : updates) { ListPluginComponent component = myBundledUpdateGroup.ui.findComponent(descriptor); if (component != null) { component.setUpdateDescriptor(descriptor); } } } myInstalledPanel.doLayout(); } myUpdateAll.setVisible(myUpdateAll.isVisible() && myBundledUpdateGroup.ui == null); myUpdateCounter.setVisible(myUpdateCounter.isVisible() && myBundledUpdateGroup.ui == null); }