public final class PluginManagerCore
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PluginManagerCore.EssentialPluginMissingException |
Modifier and Type | Field and Description |
---|---|
static PluginId |
CORE_ID |
static java.lang.String |
CORE_PLUGIN_ID |
static java.lang.String |
DISABLE |
static java.lang.String |
DISABLED_PLUGINS_FILENAME |
static java.lang.String |
EDIT |
static java.lang.String |
ENABLE |
static java.lang.String |
IDEA_IS_INTERNAL_PROPERTY |
static boolean |
isUnitTestMode |
static PluginId |
JAVA_PLUGIN_ID |
static java.lang.String |
META_INF |
static java.lang.String |
ourPluginError |
static java.util.Set<PluginId> |
ourPluginsToDisable |
static java.util.Set<PluginId> |
ourPluginsToEnable |
static java.lang.String |
PLUGIN_XML |
static java.lang.String |
PLUGIN_XML_PATH |
static java.lang.String |
VENDOR_JETBRAINS |
Constructor and Description |
---|
PluginManagerCore() |
Modifier and Type | Method and Description |
---|---|
static void |
addDisablePluginListener(java.lang.Runnable listener)
Deprecated.
|
static boolean |
arePluginsInitialized() |
static java.util.Map<PluginId,IdeaPluginDescriptorImpl> |
buildPluginIdMap() |
static java.util.Map<PluginId,IdeaPluginDescriptorImpl> |
buildPluginIdMap(java.util.List<IdeaPluginDescriptorImpl> descriptors) |
static PluginException |
createPluginException(java.lang.String errorMessage,
java.lang.Throwable cause,
java.lang.Class<?> pluginClass)
This is an internal method, use
PluginException.createByClass(String, Throwable, Class) instead. |
static java.util.Set<PluginId> |
disabledPlugins() |
static boolean |
disablePlugin(PluginId id) |
static boolean |
disablePlugin(java.lang.String id)
Deprecated.
|
static void |
dontLoadDisabledPlugins() |
static boolean |
enablePlugin(PluginId id) |
static boolean |
enablePlugin(java.lang.String id)
Deprecated.
|
static IdeaPluginDescriptor |
findPluginByModuleDependency(PluginId id) |
static java.util.List<java.lang.String> |
getDisabledPlugins()
Deprecated.
Bad API, sorry. Please use
isDisabled(PluginId) to check plugin's state,
enablePlugin(PluginId) /disablePlugin(PluginId) for state management,
disabledPlugins() to get an unmodifiable collection of all disabled plugins (rarely needed). |
static java.util.List<IdeaPluginDescriptorImpl> |
getEnabledPluginRawList()
Think twice before use and get approve from core team.
|
static java.util.List<? extends IdeaPluginDescriptor> |
getLoadedPlugins()
Returns descriptors of plugins which are successfully loaded into IDE.
|
static java.util.List<IdeaPluginDescriptorImpl> |
getLoadedPlugins(java.lang.ClassLoader coreClassLoader) |
static Logger |
getLogger() |
static IdeaPluginDescriptor |
getPlugin(PluginId id) |
static PluginId |
getPluginByClassName(java.lang.String className) |
static PluginDescriptor |
getPluginDescriptorOrPlatformByClassName(java.lang.String className) |
static PluginId |
getPluginOrPlatformByClassName(java.lang.String className) |
static IdeaPluginDescriptor [] |
getPlugins()
Returns list of all available plugin descriptors (bundled and custom, include disabled ones).
|
static java.lang.String |
getPluginsCompatibleBuild() |
static void |
initClassLoader(IdeaPluginDescriptorImpl rootDescriptor) |
static java.util.concurrent.CompletionStage<java.util.List<IdeaPluginDescriptorImpl>> |
initPlugins(java.lang.ClassLoader coreClassLoader) |
static void |
invalidatePlugins() |
static boolean |
isBrokenPlugin(IdeaPluginDescriptor descriptor) |
static boolean |
isCompatible(IdeaPluginDescriptor descriptor) |
static boolean |
isCompatible(IdeaPluginDescriptor descriptor,
BuildNumber buildNumber) |
static boolean |
isDisabled(PluginId pluginId) |
static boolean |
isDisabled(java.lang.String pluginId)
Deprecated.
|
static boolean |
isIncompatible(IdeaPluginDescriptor descriptor) |
static boolean |
isIncompatible(IdeaPluginDescriptor descriptor,
BuildNumber buildNumber) |
static boolean |
isModuleDependency(PluginId dependentPluginId) |
static boolean |
isPluginInstalled(PluginId id) |
static boolean |
isRunningFromSources() |
static IdeaPluginDescriptorImpl |
loadDescriptor(java.io.File file,
java.lang.String fileName)
Deprecated.
|
static IdeaPluginDescriptorImpl |
loadDescriptor(java.nio.file.Path file,
boolean isBundled,
com.intellij.ide.plugins.DescriptorListLoadingContext parentContext) |
static void |
loadDisabledPlugins(java.lang.String configPath,
java.util.Collection<PluginId> disabledPlugins) |
static java.util.List<? extends IdeaPluginDescriptor> |
loadUncachedDescriptors()
Think twice before use and get approve from core team.
|
static boolean |
processAllDependencies(IdeaPluginDescriptor rootDescriptor,
boolean withOptionalDeps,
java.util.function.Function<IdeaPluginDescriptor,java.nio.file.FileVisitResult> consumer)
You must not use this method in cycle, in this case use
processAllDependencies(IdeaPluginDescriptor, boolean, Map, Function) instead
(to reuse result of buildPluginIdMap() ). |
static boolean |
processAllDependencies(IdeaPluginDescriptor rootDescriptor,
boolean withOptionalDeps,
java.util.Map<PluginId,IdeaPluginDescriptorImpl> idToMap,
java.util.function.Function<IdeaPluginDescriptor,java.nio.file.FileVisitResult> consumer) |
static void |
registerExtensionPointAndExtensions(java.nio.file.Path pluginRoot,
java.lang.String fileName,
ExtensionsArea area)
Load extensions points and extensions from a configuration file in plugin.xml format
|
static void |
removeDisablePluginListener(java.lang.Runnable listener)
Deprecated.
|
static void |
saveDisabledPlugins(java.util.Collection<PluginId> ids,
boolean append) |
static void |
saveDisabledPlugins(java.lang.String configPath,
java.util.Collection<PluginId> ids,
boolean append) |
static void |
savePluginsList(java.util.Collection<PluginId> ids,
java.nio.file.Path file,
boolean append) |
static void |
scheduleDescriptorLoading() |
static void |
setDisabledPluginListener(java.lang.Runnable value) |
static java.util.List<? extends IdeaPluginDescriptor> |
testLoadDescriptorsFromClassPath(java.lang.ClassLoader loader) |
static void |
writePluginsList(java.util.Collection<PluginId> ids,
java.io.Writer writer) |
public static final java.lang.String META_INF
public static final java.lang.String IDEA_IS_INTERNAL_PROPERTY
public static final java.lang.String DISABLED_PLUGINS_FILENAME
public static final PluginId CORE_ID
public static final java.lang.String CORE_PLUGIN_ID
public static final PluginId JAVA_PLUGIN_ID
public static final java.lang.String PLUGIN_XML
public static final java.lang.String PLUGIN_XML_PATH
public static final java.lang.String VENDOR_JETBRAINS
public static final java.lang.String DISABLE
public static final java.lang.String ENABLE
public static final java.lang.String EDIT
public static volatile boolean isUnitTestMode
public static java.lang.String ourPluginError
public static java.util.Set<PluginId> ourPluginsToDisable
public static java.util.Set<PluginId> ourPluginsToEnable
public static java.lang.String getPluginsCompatibleBuild()
public static void setDisabledPluginListener(java.lang.Runnable value)
public static IdeaPluginDescriptor [] getPlugins()
getLoadedPlugins()
if you need to get loaded plugins only.
Do not call this method during bootstrap, should be called in a copy of PluginManager, loaded by PluginClassLoader.
public static java.util.List<? extends IdeaPluginDescriptor> getLoadedPlugins()
public static java.util.List<IdeaPluginDescriptorImpl> getLoadedPlugins(java.lang.ClassLoader coreClassLoader)
public static boolean arePluginsInitialized()
public static void loadDisabledPlugins(java.lang.String configPath, java.util.Collection<PluginId> disabledPlugins)
public static void dontLoadDisabledPlugins()
@Deprecated public static java.util.List<java.lang.String> getDisabledPlugins()
isDisabled(PluginId)
to check plugin's state,
enablePlugin(PluginId)
/disablePlugin(PluginId)
for state management,
disabledPlugins()
to get an unmodifiable collection of all disabled plugins (rarely needed).public static java.util.Set<PluginId> disabledPlugins()
public static boolean isDisabled(PluginId pluginId)
@Deprecated public static boolean isDisabled(java.lang.String pluginId)
isDisabled(PluginId)
public static boolean isBrokenPlugin(IdeaPluginDescriptor descriptor)
public static void savePluginsList(java.util.Collection<PluginId> ids, java.nio.file.Path file, boolean append) throws java.io.IOException
java.io.IOException
public static void writePluginsList(java.util.Collection<PluginId> ids, java.io.Writer writer) throws java.io.IOException
java.io.IOException
@Deprecated public static boolean disablePlugin(java.lang.String id)
disablePlugin(PluginId)
public static boolean disablePlugin(PluginId id)
public static boolean enablePlugin(PluginId id)
@Deprecated public static boolean enablePlugin(java.lang.String id)
enablePlugin(PluginId)
public static void saveDisabledPlugins(java.util.Collection<PluginId> ids, boolean append) throws java.io.IOException
java.io.IOException
public static void saveDisabledPlugins(java.lang.String configPath, java.util.Collection<PluginId> ids, boolean append) throws java.io.IOException
java.io.IOException
public static boolean isModuleDependency(PluginId dependentPluginId)
public static PluginException createPluginException(java.lang.String errorMessage, java.lang.Throwable cause, java.lang.Class<?> pluginClass)
PluginException.createByClass(String, Throwable, Class)
instead.public static PluginId getPluginByClassName(java.lang.String className)
public static PluginId getPluginOrPlatformByClassName(java.lang.String className)
public static PluginDescriptor getPluginDescriptorOrPlatformByClassName(java.lang.String className)
public static void invalidatePlugins()
public static boolean isRunningFromSources()
@Deprecated public static IdeaPluginDescriptorImpl loadDescriptor(java.io.File file, java.lang.String fileName)
PluginManager.loadDescriptor(Path, String)
public static IdeaPluginDescriptorImpl loadDescriptor(java.nio.file.Path file, boolean isBundled, com.intellij.ide.plugins.DescriptorListLoadingContext parentContext)
public static java.util.List<? extends IdeaPluginDescriptor> testLoadDescriptorsFromClassPath(java.lang.ClassLoader loader) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.lang.InterruptedException
public static java.util.List<? extends IdeaPluginDescriptor> loadUncachedDescriptors()
public static void scheduleDescriptorLoading()
public static java.util.List<IdeaPluginDescriptorImpl> getEnabledPluginRawList()
public static java.util.concurrent.CompletionStage<java.util.List<IdeaPluginDescriptorImpl>> initPlugins(java.lang.ClassLoader coreClassLoader)
public static void initClassLoader(IdeaPluginDescriptorImpl rootDescriptor)
public static boolean isCompatible(IdeaPluginDescriptor descriptor)
public static boolean isCompatible(IdeaPluginDescriptor descriptor, BuildNumber buildNumber)
public static boolean isIncompatible(IdeaPluginDescriptor descriptor)
public static boolean isIncompatible(IdeaPluginDescriptor descriptor, BuildNumber buildNumber)
public static java.util.Map<PluginId,IdeaPluginDescriptorImpl> buildPluginIdMap(java.util.List<IdeaPluginDescriptorImpl> descriptors)
public static void registerExtensionPointAndExtensions(java.nio.file.Path pluginRoot, java.lang.String fileName, ExtensionsArea area)
Use it only for CoreApplicationEnvironment. Do not use otherwise. For IntelliJ Platform application and tests plugins are loaded in parallel (including other optimizations).
pluginRoot
- jar file or directory which contains the configuration filefileName
- name of the configuration file located in 'META-INF' directory under pluginRoot
area
- area which extension points and extensions should be registered (e.g. Extensions.getRootArea()
for application-level extensions)public static Logger getLogger()
public static IdeaPluginDescriptor getPlugin(PluginId id)
public static IdeaPluginDescriptor findPluginByModuleDependency(PluginId id)
public static boolean isPluginInstalled(PluginId id)
public static java.util.Map<PluginId,IdeaPluginDescriptorImpl> buildPluginIdMap()
public static boolean processAllDependencies(IdeaPluginDescriptor rootDescriptor, boolean withOptionalDeps, java.util.function.Function<IdeaPluginDescriptor,java.nio.file.FileVisitResult> consumer)
processAllDependencies(IdeaPluginDescriptor, boolean, Map, Function)
instead
(to reuse result of buildPluginIdMap()
).
FileVisitResult.SKIP_SIBLINGS
is not supported.
Returns false
if processing was terminated because of FileVisitResult.TERMINATE
, and true
otherwise.public static boolean processAllDependencies(IdeaPluginDescriptor rootDescriptor, boolean withOptionalDeps, java.util.Map<PluginId,IdeaPluginDescriptorImpl> idToMap, java.util.function.Function<IdeaPluginDescriptor,java.nio.file.FileVisitResult> consumer)
@Deprecated public static void addDisablePluginListener(java.lang.Runnable listener)
PluginManager.addDisablePluginListener(java.lang.Runnable)
@Deprecated public static void removeDisablePluginListener(java.lang.Runnable listener)
PluginManager.addDisablePluginListener(java.lang.Runnable)