Search in sources :

Example 11 with PluginId

use of com.intellij.openapi.extensions.PluginId in project intellij-community by JetBrains.

the class InstalledPluginsManagerMain method isPluginStateChanged.

private boolean isPluginStateChanged(final IdeaPluginDescriptor pluginDescriptor, final List<String> disabledPlugins) {
    final PluginId pluginId = pluginDescriptor.getPluginId();
    final boolean enabledInTable = ((InstalledPluginsTableModel) pluginsModel).isEnabled(pluginId);
    if (pluginDescriptor.isEnabled() != enabledInTable) {
        if (enabledInTable && !disabledPlugins.contains(pluginId.getIdString())) {
            //was disabled automatically on startup
            return false;
        }
        return true;
    }
    return false;
}
Also used : PluginId(com.intellij.openapi.extensions.PluginId)

Example 12 with PluginId

use of com.intellij.openapi.extensions.PluginId in project intellij-community by JetBrains.

the class InstalledPluginsState method onPluginInstall.

/**
   * Should be called whenever a new plugin is installed or an existing one is updated.
   */
public void onPluginInstall(@NotNull IdeaPluginDescriptor descriptor) {
    PluginId id = descriptor.getPluginId();
    boolean existing = PluginManager.isPluginInstalled(id);
    synchronized (myLock) {
        myOutdatedPlugins.remove(id.getIdString());
        if (existing) {
            myUpdatedPlugins.put(id, descriptor);
        } else {
            myInstalledPlugins.put(id, descriptor);
        }
    }
}
Also used : PluginId(com.intellij.openapi.extensions.PluginId)

Example 13 with PluginId

use of com.intellij.openapi.extensions.PluginId in project intellij-community by JetBrains.

the class InstalledPluginsTableModel method appendOrUpdateDescriptor.

public void appendOrUpdateDescriptor(@NotNull IdeaPluginDescriptor descriptor) {
    PluginId id = descriptor.getPluginId();
    if (!PluginManager.isPluginInstalled(id)) {
        List<IdeaPluginDescriptor> list = isPluginDescriptorAccepted(descriptor) ? view : filtered;
        int i = list.indexOf(descriptor);
        if (i < 0) {
            list.add(descriptor);
        } else {
            list.set(i, descriptor);
        }
        setEnabled(descriptor, true);
        fireTableDataChanged();
    }
}
Also used : PluginId(com.intellij.openapi.extensions.PluginId)

Example 14 with PluginId

use of com.intellij.openapi.extensions.PluginId in project intellij-community by JetBrains.

the class InstalledPluginsTableModel method setEnabled.

private void setEnabled(IdeaPluginDescriptor ideaPluginDescriptor, boolean enabled) {
    final Collection<String> disabledPlugins = PluginManagerCore.getDisabledPlugins();
    final PluginId pluginId = ideaPluginDescriptor.getPluginId();
    if (!enabled && !disabledPlugins.contains(pluginId.toString())) {
        myEnabled.put(pluginId, null);
    } else {
        myEnabled.put(pluginId, enabled);
    }
}
Also used : PluginId(com.intellij.openapi.extensions.PluginId)

Example 15 with PluginId

use of com.intellij.openapi.extensions.PluginId in project intellij-community by JetBrains.

the class InstalledPluginsTableModel method enableRows.

public void enableRows(IdeaPluginDescriptor[] ideaPluginDescriptors, Boolean value) {
    for (IdeaPluginDescriptor ideaPluginDescriptor : ideaPluginDescriptors) {
        final PluginId currentPluginId = ideaPluginDescriptor.getPluginId();
        final Boolean enabled = myEnabled.get(currentPluginId) == null ? Boolean.FALSE : value;
        myEnabled.put(currentPluginId, enabled);
    }
    updatePluginDependencies();
    warnAboutMissedDependencies(value, ideaPluginDescriptors);
    hideNotApplicablePlugins(value, ideaPluginDescriptors);
}
Also used : PluginId(com.intellij.openapi.extensions.PluginId)

Aggregations

PluginId (com.intellij.openapi.extensions.PluginId)54 IdeaPluginDescriptor (com.intellij.ide.plugins.IdeaPluginDescriptor)25 NotNull (org.jetbrains.annotations.NotNull)10 IOException (java.io.IOException)8 IdeaLoggingEvent (com.intellij.openapi.diagnostic.IdeaLoggingEvent)6 Project (com.intellij.openapi.project.Project)6 Nullable (org.jetbrains.annotations.Nullable)6 SubmittedReportInfo (com.intellij.openapi.diagnostic.SubmittedReportInfo)5 PluginException (com.intellij.diagnostic.PluginException)4 DataContext (com.intellij.openapi.actionSystem.DataContext)4 NonNls (org.jetbrains.annotations.NonNls)4 ErrorBean (com.intellij.errorreport.bean.ErrorBean)3 EmptyProgressIndicator (com.intellij.openapi.progress.EmptyProgressIndicator)3 PluginDownloader (com.intellij.openapi.updateSettings.impl.PluginDownloader)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 File (java.io.File)3 AbstractMessage (com.intellij.diagnostic.AbstractMessage)2 LogMessageEx (com.intellij.diagnostic.LogMessageEx)2 CantRunException (com.intellij.execution.CantRunException)2 DataManager (com.intellij.ide.DataManager)2