void (@NotNull PluginsGroup group, @NotNull IdeaPluginDescriptor descriptor) { int index = group.addWithIndex(descriptor); ListPluginComponent anchor = null; int uiIndex = -1; if (index == group.ui.plugins.size()) { int groupIndex = myGroups.indexOf(group.ui); if (groupIndex < myGroups.size() - 1) { UIPluginGroup nextGroup = myGroups.get(groupIndex + 1); anchor = nextGroup.plugins.get(0); uiIndex = getComponentIndex(nextGroup.panel); } } else { anchor = group.ui.plugins.get(index); uiIndex = getComponentIndex(anchor); } ListPluginComponent pluginComponent = createListComponent(descriptor, group); group.ui.plugins.add(index, pluginComponent); add(pluginComponent, uiIndex); myEventHandler.addCell(pluginComponent, anchor); pluginComponent.setListeners(myEventHandler); }