From baf632a9f81a8d913a33fa4735b82ab4f670c3b6 Mon Sep 17 00:00:00 2001 From: Mykhailo Lytvyn <> Date: Sun, 8 Jan 2023 18:08:41 +0100 Subject: [PATCH 1/2] Deprecated API - Plugin dependencies identification during project import --- .../configurators/impl/MavenUtils.java | 2 +- .../wizard/CheckRequiredPluginsStep.java | 50 ++++++++++--------- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/MavenUtils.java b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/MavenUtils.java index 29cf59aa0..7064f2007 100644 --- a/src/com/intellij/idea/plugin/hybris/project/configurators/impl/MavenUtils.java +++ b/src/com/intellij/idea/plugin/hybris/project/configurators/impl/MavenUtils.java @@ -107,7 +107,7 @@ private static List resolveMavenDependencies( moduleDirPath, moduleDirPath ); - final MavenGeneralSettings generalSettings = settings.generalSettings; + final MavenGeneralSettings generalSettings = settings.getGeneralSettings(); generalSettings.setNonRecursive(true); final MavenProjectsTree mavenProjectsTree = new MavenProjectsTree(project); diff --git a/src/com/intellij/idea/plugin/hybris/project/wizard/CheckRequiredPluginsStep.java b/src/com/intellij/idea/plugin/hybris/project/wizard/CheckRequiredPluginsStep.java index b8aee979c..c9170ec38 100644 --- a/src/com/intellij/idea/plugin/hybris/project/wizard/CheckRequiredPluginsStep.java +++ b/src/com/intellij/idea/plugin/hybris/project/wizard/CheckRequiredPluginsStep.java @@ -18,6 +18,7 @@ package com.intellij.idea.plugin.hybris.project.wizard; +import com.intellij.ide.plugins.IdeaPluginDependency; import com.intellij.ide.plugins.IdeaPluginDescriptor; import com.intellij.ide.plugins.PluginManager; import com.intellij.ide.plugins.PluginManagerCore; @@ -46,8 +47,8 @@ public class CheckRequiredPluginsStep extends ProjectImportWizardStep { private JPanel rootPanel; private JLabel warningLabel; private JTextPane descriptionTextPane; - private JList notInstalledList; - private JList notEnabledList; + private JList notInstalledList; + private JList notEnabledList; private JLabel notInstalledLablel; private JLabel notEnabledLabel; private JButton enableButton; @@ -82,33 +83,36 @@ public void updateDataModel() { public boolean isStepVisible() { notInstalledPlugins.clear(); notEnabledPlugins.clear(); - checkDependentPlugins(); - boolean missing = isAnyMissing(); - if (!missing) { + validateDependentPlugins(); + if (!isAnyMissing()) { return false; } fillInGUI(); return true; } - private void checkDependentPlugins() { + private void validateDependentPlugins() { final IdeaPluginDescriptor hybrisPlugin = PluginManagerCore.getPlugin(PluginId.getId(HybrisConstants.PLUGIN_ID)); - final PluginId[] dependentPluginIds = hybrisPlugin.getOptionalDependentPluginIds(); - Arrays.stream(dependentPluginIds).forEach(id -> { - if (id.getIdString().startsWith(EXCLUDED_ID_PREFIX)) { - return; - } - final boolean installed = PluginManager.isPluginInstalled(id); - if (!installed) { - notInstalledPlugins.add(id); - return; - } - final IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(id); - if (plugin != null && !plugin.isEnabled()) { - notEnabledPlugins.add(id); - } - }); + if (hybrisPlugin == null) return; + + hybrisPlugin.getDependencies().stream() + .filter(IdeaPluginDependency::isOptional) + .map(IdeaPluginDependency::getPluginId) + .forEach(id -> { + if (id.getIdString().startsWith(EXCLUDED_ID_PREFIX)) { + return; + } + if (!PluginManager.isPluginInstalled(id)) { + notInstalledPlugins.add(id); + return; + } + + final IdeaPluginDescriptor plugin = PluginManagerCore.getPlugin(id); + if (plugin != null && !plugin.isEnabled()) { + notEnabledPlugins.add(id); + } + }); } private void fillInGUI() { @@ -139,8 +143,8 @@ public boolean isAnyMissing() { } private void createUIComponents() { - notInstalledList = new JBList(new DefaultListModel()); - notEnabledList = new JBList(new DefaultListModel()); + notInstalledList = new JBList<>(new DefaultListModel<>()); + notEnabledList = new JBList<>(new DefaultListModel<>()); enableButton = new JButton(); enableButton.addActionListener(e -> enablePlugins()); } From 6d3e35be5517bdc4adb02d35fa104bc576b950c3 Mon Sep 17 00:00:00 2001 From: Mykhailo Lytvyn <> Date: Sun, 8 Jan 2023 18:09:39 +0100 Subject: [PATCH 2/2] - release notes --- resources/META-INF/plugin-release-info.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/META-INF/plugin-release-info.xml b/resources/META-INF/plugin-release-info.xml index a5159aabc..5417a74be 100644 --- a/resources/META-INF/plugin-release-info.xml +++ b/resources/META-INF/plugin-release-info.xml @@ -132,7 +132,8 @@ #135, #136, #137, - #138) + #138, + #139)
  • Bug Fix: [y] Tool Window Logo too dark for New UI (#95)
  • Bug Fix: [y] Tool Window is not available after project import (#125)
  • Bug Fix: Impex config processor inspection does not work (#100)