public abstract class ExtensionPointImpl<T> extends java.lang.Object implements ExtensionPoint<T>, java.lang.Iterable<T>
ExtensionPoint.Kind
Modifier and Type | Field and Description |
---|---|
protected PluginDescriptor |
myDescriptor |
Modifier and Type | Method and Description |
---|---|
void |
addExtensionPointListener(ExtensionPointChangeListener listener,
boolean invokeForLoadedExtensions,
Disposable parentDisposable) |
void |
addExtensionPointListener(ExtensionPointListener<T> listener) |
void |
addExtensionPointListener(ExtensionPointListener<T> listener,
boolean invokeForLoadedExtensions,
Disposable parentDisposable) |
void |
clearExtensionClass() |
abstract ExtensionPointImpl<T> |
cloneFor(ComponentManager manager) |
protected abstract ExtensionComponentAdapter |
createAdapterAndRegisterInPicoContainerIfNeeded(Element extensionElement,
PluginDescriptor pluginDescriptor,
ComponentManager componentManager) |
java.util.stream.Stream<T> |
extensions() |
<V extends T> |
findExtension(java.lang.Class<V> aClass,
boolean isRequired,
ThreeState strictMatch) |
java.lang.String |
getClassName() |
ComponentManager |
getComponentManager() |
java.lang.Class<T> |
getExtensionClass() |
java.util.List<T> |
getExtensionList() |
T [] |
getExtensions()
Prefer to use
ExtensionPoint.getExtensionList() . |
java.lang.String |
getName() |
PluginDescriptor |
getPluginDescriptor() |
PluginDescriptor |
getPluginDescriptor(T extension) |
boolean |
hasAnyExtensions() |
boolean |
isDynamic() |
java.util.Iterator<T> |
iterator()
Do not use it if there is any extension point listener, because in this case behaviour is not predictable -
events will be fired during iteration and probably it will be not expected.
|
void |
maskAll(java.util.List<? extends T> list,
Disposable parentDisposable,
boolean fireEvents)
Put extension point in read-only mode and replace existing extensions by supplied.
|
void |
processImplementations(boolean shouldBeSorted,
java.util.function.BiConsumer<java.util.function.Supplier<T>,? super PluginDescriptor> consumer) |
void |
processWithPluginDescriptor(boolean shouldBeSorted,
java.util.function.BiConsumer<? super T,? super PluginDescriptor> consumer) |
void |
registerExtension(T extension) |
void |
registerExtension(T extension,
Disposable parentDisposable) |
void |
registerExtension(T extension,
LoadingOrder order) |
void |
registerExtension(T extension,
LoadingOrder order,
Disposable parentDisposable)
Use
com.intellij.testFramework.PlatformTestUtil#maskExtensions
to register extension as first or to completely replace existing extensions in tests. |
void |
registerExtensions(java.util.List<? extends T> extensions)
There are valid cases where we need to register a lot of extensions programmatically,
e.g.
|
void |
removeExtensionPointListener(ExtensionPointListener<T> listener) |
void |
removeUnloadableExtensions() |
void |
reset() |
static void |
setCheckCanceledAction(java.lang.Runnable checkCanceled) |
java.lang.String |
toString() |
void |
unregisterExtension(java.lang.Class<? extends T> extensionClass)
Unregisters an extension of the specified type.
|
void |
unregisterExtension(T extension) |
boolean |
unregisterExtensions(java.util.function.BiPredicate<? super java.lang.String,? super ExtensionComponentAdapter> extensionClassFilter,
boolean stopAfterFirstMatch)
Unregisters extensions for which the specified predicate returns false.
|
boolean |
unregisterExtensions(java.util.function.BiPredicate<? super java.lang.String,? super ExtensionComponentAdapter> extensionClassFilter,
boolean stopAfterFirstMatch,
java.util.List<java.lang.Runnable> listenerCallbacks)
Unregisters extensions for which the specified predicate returns false and collects the callables for listener invocation into the given list
so that listeners can be called later.
|
abstract void |
unregisterExtensions(PluginDescriptor pluginDescriptor,
java.util.List<Element> elements,
java.util.List<java.lang.Runnable> listenerCallbacks) |
void |
unregisterExtensions(java.util.function.Predicate<? super T> filter) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getExtension, hasExtension
protected final PluginDescriptor myDescriptor
public java.lang.String getName()
getName
in interface ExtensionPoint<T>
public java.lang.String getClassName()
getClassName
in interface ExtensionPoint<T>
public boolean isDynamic()
isDynamic
in interface ExtensionPoint<T>
public void registerExtension(T extension)
registerExtension
in interface ExtensionPoint<T>
public void registerExtension(T extension, LoadingOrder order)
registerExtension
in interface ExtensionPoint<T>
public void registerExtension(T extension, Disposable parentDisposable)
registerExtension
in interface ExtensionPoint<T>
public final PluginDescriptor getPluginDescriptor()
getPluginDescriptor
in interface ExtensionPoint<T>
public void registerExtension(T extension, LoadingOrder order, Disposable parentDisposable)
ExtensionPoint
com.intellij.testFramework.PlatformTestUtil#maskExtensions
to register extension as first or to completely replace existing extensions in tests.registerExtension
in interface ExtensionPoint<T>
public ComponentManager getComponentManager()
public void registerExtensions(java.util.List<? extends T> extensions)
public java.util.List<T> getExtensionList()
getExtensionList
in interface ExtensionPoint<T>
public T [] getExtensions()
ExtensionPoint
ExtensionPoint.getExtensionList()
.getExtensions
in interface ExtensionPoint<T>
public final java.util.Iterator<T> iterator()
Use only for interface extension points, not for bean.
Due to internal reasons, there is no easy way to implement hasNext in a reliable manner, so, `next` may return `null` (in this case stop iteration).
iterator
in interface java.lang.Iterable<T>
public final void processWithPluginDescriptor(boolean shouldBeSorted, java.util.function.BiConsumer<? super T,? super PluginDescriptor> consumer)
public final void processImplementations(boolean shouldBeSorted, java.util.function.BiConsumer<java.util.function.Supplier<T>,? super PluginDescriptor> consumer)
public java.util.stream.Stream<T> extensions()
extensions
in interface ExtensionPoint<T>
public boolean hasAnyExtensions()
hasAnyExtensions
in interface ExtensionPoint<T>
public abstract ExtensionPointImpl<T> cloneFor(ComponentManager manager)
public void removeUnloadableExtensions()
public void maskAll(java.util.List<? extends T> list, Disposable parentDisposable, boolean fireEvents)
#registerExtension)
because makes registration more isolated and strict
(no one can modify extension point until `parentDisposable` is not disposed).
Please use com.intellij.testFramework.ExtensionTestUtil#maskExtensions(ExtensionPointName, List, Disposable)
instead of direct usage.
public void unregisterExtensions(java.util.function.Predicate<? super T> filter)
unregisterExtensions
in interface ExtensionPoint<T>
public void unregisterExtension(T extension)
unregisterExtension
in interface ExtensionPoint<T>
public void unregisterExtension(java.lang.Class<? extends T> extensionClass)
ExtensionPoint
ExtensionNotApplicableException
instead.unregisterExtension
in interface ExtensionPoint<T>
public boolean unregisterExtensions(java.util.function.BiPredicate<? super java.lang.String,? super ExtensionComponentAdapter> extensionClassFilter, boolean stopAfterFirstMatch)
ExtensionPoint
ExtensionNotApplicableException
instead.unregisterExtensions
in interface ExtensionPoint<T>
public boolean unregisterExtensions(java.util.function.BiPredicate<? super java.lang.String,? super ExtensionComponentAdapter> extensionClassFilter, boolean stopAfterFirstMatch, java.util.List<java.lang.Runnable> listenerCallbacks)
ExtensionPoint
unregisterExtensions
in interface ExtensionPoint<T>
public abstract void unregisterExtensions(PluginDescriptor pluginDescriptor, java.util.List<Element> elements, java.util.List<java.lang.Runnable> listenerCallbacks)
public void addExtensionPointListener(ExtensionPointListener<T> listener, boolean invokeForLoadedExtensions, Disposable parentDisposable)
addExtensionPointListener
in interface ExtensionPoint<T>
public void addExtensionPointListener(ExtensionPointListener<T> listener)
addExtensionPointListener
in interface ExtensionPoint<T>
public void addExtensionPointListener(ExtensionPointChangeListener listener, boolean invokeForLoadedExtensions, Disposable parentDisposable)
addExtensionPointListener
in interface ExtensionPoint<T>
public void removeExtensionPointListener(ExtensionPointListener<T> listener)
removeExtensionPointListener
in interface ExtensionPoint<T>
public void reset()
reset
in interface ExtensionPoint<T>
public java.lang.Class<T> getExtensionClass()
public void clearExtensionClass()
public java.lang.String toString()
toString
in class java.lang.Object
protected abstract ExtensionComponentAdapter createAdapterAndRegisterInPicoContainerIfNeeded(Element extensionElement, PluginDescriptor pluginDescriptor, ComponentManager componentManager)
public final PluginDescriptor getPluginDescriptor(T extension)
public final <V extends T> V findExtension(java.lang.Class<V> aClass, boolean isRequired, ThreeState strictMatch)
public static void setCheckCanceledAction(java.lang.Runnable checkCanceled)