private void setGlobalOptions() { globalOptions.clear(); globalOptionsSetter.clear(); for(Plugin p : plugins()) { if (p.isGloballyEnabled()) { for(Map.Entry<String, String> e : p.getMyGlobalOptions().entrySet()) { String key = e.getKey(); String value = e.getValue(); String oldValue = globalOptions.get(key); if (oldValue != null) { if (oldValue.equals(value)) { continue; } Plugin oldP = globalOptionsSetter.get(key); throw new RuntimeException( "Incompatible global options for " + key + "; conflict between " + oldP.getPluginId() + " and " + p.getPluginId()); } globalOptions.put(key, value); globalOptionsSetter.put(key, p); } } } }
private DetectorFactoryCollection(boolean loadCore, boolean forceLoad, @Nonnull Collection<Plugin> pluginsToLoad, @Nonnull Collection<Plugin> enabledPlugins) { if(loadCore) { loadCorePlugin(); } for(Plugin plugin : pluginsToLoad) { if (forceLoad || plugin.isGloballyEnabled() && !plugin.isCorePlugin()) { loadPlugin(plugin); if(!enabledPlugins.contains(plugin)) { enabledPlugins.add(plugin); } } } setGlobalOptions(); // There are too many places where the detector factory collection can be created, // and in many cases it has nothing to do with update checks, like Plugin#addCustomPlugin(URI). // Line below commented to allow custom plugins be loaded/registered BEFORE we // start to update something. The reason is that custom plugins // can disable update globally OR just will be NOT INCLUDED in the update check! // updateChecker.checkForUpdates(pluginsToUpdate, false); }
LOG.info(" is enabled by default"); if (plugin.isGloballyEnabled()) { LOG.info(" is globally enabled");
EnabledSettings isEnabled(@CheckForNull Project project, Plugin plugin) { return new EnabledSettings(plugin.isGloballyEnabled(), project == null ? null : project.getPluginStatus(plugin)); }
private void setGlobalOptions() { globalOptions.clear(); globalOptionsSetter.clear(); for(Plugin p : plugins()) { if (p.isGloballyEnabled()) { for(Map.Entry<String, String> e : p.getMyGlobalOptions().entrySet()) { String key = e.getKey(); String value = e.getValue(); String oldValue = globalOptions.get(key); if (oldValue != null) { if (oldValue.equals(value)) { continue; } Plugin oldP = globalOptionsSetter.get(key); throw new RuntimeException( "Incompatible global options for " + key + "; conflict between " + oldP.getPluginId() + " and " + p.getPluginId()); } globalOptions.put(key, value); globalOptionsSetter.put(key, p); } } } } @Override
private DetectorFactoryCollection(boolean loadCore, boolean forceLoad, @Nonnull Collection<Plugin> pluginsToLoad, @Nonnull Collection<Plugin> enabledPlugins) { if(loadCore) { loadCorePlugin(); } for(Plugin plugin : pluginsToLoad) { if (forceLoad || plugin.isGloballyEnabled() && !plugin.isCorePlugin()) { loadPlugin(plugin); if(!enabledPlugins.contains(plugin)) { enabledPlugins.add(plugin); } } } setGlobalOptions(); updateChecker = new UpdateChecker(this); pluginsToUpdate = combine(enabledPlugins); // There are too many places where the detector factory collection can be created, // and in many cases it has nothing to do with update checks, like Plugin#addCustomPlugin(URI). // Line below commented to allow custom plugins be loaded/registered BEFORE we // start to update something. The reason is that custom plugins // can disable update globally OR just will be NOT INCLUDED in the update check! // updateChecker.checkForUpdates(pluginsToUpdate, false); }
System.out.println(" is enabled by default"); if (plugin.isGloballyEnabled()) { System.out.println(" is globally enabled");
disabledPlugins.add(plugin.getPluginId()); if (plugin.isGloballyEnabled() != enabled.global) { plugin.setGloballyEnabled(enabled.global); changed = true;