use of com.intellij.ide.plugins.IdeaPluginDescriptor in project intellij-community by JetBrains.
the class PluginGroups method getNonOptionalDependencies.
private List<String> getNonOptionalDependencies(final String id) {
List<String> result = new ArrayList<>();
IdeaPluginDescriptor descriptor = findPlugin(id);
if (descriptor != null) {
for (PluginId pluginId : descriptor.getDependentPluginIds()) {
if (pluginId.getIdString().equals("com.intellij"))
continue;
if (!ArrayUtil.contains(pluginId, descriptor.getOptionalDependentPluginIds())) {
result.add(pluginId.getIdString());
}
}
}
return result;
}
use of com.intellij.ide.plugins.IdeaPluginDescriptor in project intellij-community by JetBrains.
the class SelectPluginsStep method onNext.
@Override
public WizardStep onNext(final StartupWizardModel model) {
final WizardStep next = super.onNext(model);
if (next instanceof SelectPluginsStep) {
final SelectPluginsStep selectPluginsStep = (SelectPluginsStep) next;
final String id = selectPluginsStep.getRequirePlugin();
if (id != null && model.getDisabledPluginIds().contains(id) && !model.isLast(next)) {
for (IdeaPluginDescriptor descriptor : selectPluginsStep.getPlugins()) {
model.getDisabledPluginIds().add(descriptor.getPluginId().getIdString());
}
return model.getNextFor(next);
}
}
return next;
}
use of com.intellij.ide.plugins.IdeaPluginDescriptor in project intellij-community by JetBrains.
the class StartupWizardModel method getDependentsOnEarlierPages.
public List<IdeaPluginDescriptor> getDependentsOnEarlierPages(IdeaPluginDescriptor descriptor, boolean includeSamePage) {
List<IdeaPluginDescriptor> dependents = new ArrayList<>();
int thisStep = getPluginStepIndex(descriptor);
for (IdeaPluginDescriptor dependent : myBackwardDependencies.get(descriptor)) {
if (!myDisabledPluginIds.contains(dependent.getPluginId().toString())) {
int index = getPluginStepIndex(dependent);
if (index < thisStep || (includeSamePage && index == thisStep && getDependentsOnEarlierPages(dependent, true).size() > 0)) {
dependents.add(dependent);
}
}
}
return dependents;
}
use of com.intellij.ide.plugins.IdeaPluginDescriptor in project intellij-community by JetBrains.
the class PluginAdvertiserEditorNotificationProvider method createPanel.
@Nullable
private EditorNotificationPanel createPanel(final String extension, final Set<PluginsAdvertiser.Plugin> plugins) {
final EditorNotificationPanel panel = new EditorNotificationPanel();
panel.setText("Plugins supporting " + extension + " files found.");
final IdeaPluginDescriptor disabledPlugin = PluginsAdvertiser.getDisabledPlugin(plugins);
if (disabledPlugin != null) {
panel.createActionLabel("Enable " + disabledPlugin.getName() + " plugin", () -> {
myEnabledExtensions.add(extension);
myNotifications.updateAllNotifications();
PluginsAdvertiser.enablePlugins(myProject, Collections.singletonList(disabledPlugin));
});
} else if (hasNonBundledPlugin(plugins)) {
panel.createActionLabel("Install plugins", () -> {
Set<String> pluginIds = new HashSet<>();
for (PluginsAdvertiser.Plugin plugin : plugins) {
pluginIds.add(plugin.myPluginId);
}
PluginsAdvertiser.installAndEnablePlugins(pluginIds, () -> {
myEnabledExtensions.add(extension);
myNotifications.updateAllNotifications();
});
});
} else if (PluginsAdvertiser.hasBundledPluginToInstall(plugins) != null) {
if (PropertiesComponent.getInstance().isTrueValue(PluginsAdvertiser.IGNORE_ULTIMATE_EDITION)) {
return null;
}
panel.setText(extension + " files are supported by " + PluginsAdvertiser.IDEA_ULTIMATE_EDITION);
panel.createActionLabel(PluginsAdvertiser.CHECK_ULTIMATE_EDITION_TITLE, () -> {
myEnabledExtensions.add(extension);
PluginsAdvertiser.openDownloadPage();
});
panel.createActionLabel(PluginsAdvertiser.ULTIMATE_EDITION_SUGGESTION, () -> {
PropertiesComponent.getInstance().setValue(PluginsAdvertiser.IGNORE_ULTIMATE_EDITION, "true");
myNotifications.updateAllNotifications();
});
} else {
return null;
}
panel.createActionLabel("Ignore extension", () -> {
UnknownFeaturesCollector.getInstance(myProject).ignoreFeature(createExtensionFeature(extension));
myNotifications.updateAllNotifications();
});
return panel;
}
use of com.intellij.ide.plugins.IdeaPluginDescriptor in project intellij-community by JetBrains.
the class BadPluginTest method testBadPlugin.
public void testBadPlugin() throws Exception {
IdeaPluginDescriptor plugin = PluginManager.getPlugin(PluginId.getId(COM_YOUR_COMPANY_UNIQUE_PLUGIN_ID));
if (plugin == null)
return;
List<String> disabledPlugins = new ArrayList<>();
PluginManagerCore.loadDisabledPlugins(PathManager.getConfigPath(), disabledPlugins);
assertEquals(1, disabledPlugins.size());
assertEquals(COM_YOUR_COMPANY_UNIQUE_PLUGIN_ID, disabledPlugins.get(0));
}
Aggregations