Search in sources :

Example 6 with DependencyOnPlugin

use of com.intellij.externalDependencies.DependencyOnPlugin in project intellij-community by JetBrains.

the class ExternalDependenciesManagerImpl method loadState.

@Override
public void loadState(ExternalDependenciesState state) {
    ArrayList<ProjectExternalDependency> oldDependencies = new ArrayList<>(myDependencies);
    myDependencies.clear();
    for (DependencyOnPluginState dependency : state.myDependencies) {
        myDependencies.add(new DependencyOnPlugin(dependency.myId, dependency.myMinVersion, dependency.myMaxVersion, dependency.myChannel));
    }
    if (!oldDependencies.equals(myDependencies) && !myDependencies.isEmpty()) {
        StartupManager.getInstance(myProject).runWhenProjectIsInitialized(new DumbAwareRunnable() {

            @Override
            public void run() {
                CheckRequiredPluginsActivity.runCheck(myProject);
            }
        });
    }
}
Also used : ArrayList(java.util.ArrayList) ProjectExternalDependency(com.intellij.externalDependencies.ProjectExternalDependency) DumbAwareRunnable(com.intellij.openapi.project.DumbAwareRunnable) DependencyOnPlugin(com.intellij.externalDependencies.DependencyOnPlugin)

Example 7 with DependencyOnPlugin

use of com.intellij.externalDependencies.DependencyOnPlugin in project intellij by bazelbuild.

the class PluginDependencyHelper method removeDependencyOnOldPlugin.

/**
 * Removes a project depedency on a given plugin, if one exists. Doesn't trigger any update
 * checking. This is to handle migration of the IntelliJ-with-Bazel plugin to a different plugin
 * ID. This is introduced in v1.9, remove in v2.2+
 */
@Deprecated
public static void removeDependencyOnOldPlugin(Project project, String pluginId) {
    ExternalDependenciesManager manager = ExternalDependenciesManager.getInstance(project);
    List<ProjectExternalDependency> deps = Lists.newArrayList(manager.getAllDependencies());
    Iterator<ProjectExternalDependency> iter = deps.iterator();
    while (iter.hasNext()) {
        ProjectExternalDependency dep = iter.next();
        if (!(dep instanceof DependencyOnPlugin)) {
            continue;
        }
        DependencyOnPlugin pluginDep = (DependencyOnPlugin) dep;
        if (pluginDep.getPluginId().equals(pluginId)) {
            iter.remove();
        }
    }
    manager.setAllDependencies(deps);
}
Also used : ExternalDependenciesManager(com.intellij.externalDependencies.ExternalDependenciesManager) ProjectExternalDependency(com.intellij.externalDependencies.ProjectExternalDependency) DependencyOnPlugin(com.intellij.externalDependencies.DependencyOnPlugin)

Aggregations

DependencyOnPlugin (com.intellij.externalDependencies.DependencyOnPlugin)7 ProjectExternalDependency (com.intellij.externalDependencies.ProjectExternalDependency)4 ExternalDependenciesManager (com.intellij.externalDependencies.ExternalDependenciesManager)2 ArrayList (java.util.ArrayList)2 Nullable (org.jetbrains.annotations.Nullable)2 IdeaPluginDescriptor (com.intellij.ide.plugins.IdeaPluginDescriptor)1 PluginId (com.intellij.openapi.extensions.PluginId)1 DumbAwareRunnable (com.intellij.openapi.project.DumbAwareRunnable)1 ComboBox (com.intellij.openapi.ui.ComboBox)1 DialogBuilder (com.intellij.openapi.ui.DialogBuilder)1 JBList (com.intellij.ui.components.JBList)1 JBTextField (com.intellij.ui.components.JBTextField)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 MouseEvent (java.awt.event.MouseEvent)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1 HyperlinkEvent (javax.swing.event.HyperlinkEvent)1 NotNull (org.jetbrains.annotations.NotNull)1