JComponent () { PluginManagerConfigurable configurable = new PluginManagerConfigurable(); JComponent panel = createPluginsPanel(configurable); panel.addAncestorListener(new AncestorListenerAdapter() { @Override public void ancestorRemoved(AncestorEvent event) { if (!configurable.isModified()) { return; } try { configurable.apply(); WelcomeScreenEventCollector.logPluginsModified(); InstalledPluginsState.getInstance().runShutdownCallback(); } catch (ConfigurationException exception) { Logger.getInstance(PluginsTabFactory.class).error(exception); } } }); return panel; }