Search in sources :

Example 1 with ExtensionsAreaImpl

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

the class Extensions method cleanRootArea.

@TestOnly
public static void cleanRootArea(@NotNull Disposable parentDisposable) {
    final ExtensionsAreaImpl oldRootArea = (ExtensionsAreaImpl) getRootArea();
    final ExtensionsAreaImpl newArea = createRootArea();
    ourRootArea = newArea;
    oldRootArea.notifyAreaReplaced();
    Disposer.register(parentDisposable, new Disposable() {

        @Override
        public void dispose() {
            ourRootArea = oldRootArea;
            newArea.notifyAreaReplaced();
        }
    });
}
Also used : Disposable(com.intellij.openapi.Disposable) ExtensionsAreaImpl(com.intellij.openapi.extensions.impl.ExtensionsAreaImpl) TestOnly(org.jetbrains.annotations.TestOnly)

Example 2 with ExtensionsAreaImpl

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

the class Extensions method createRootArea.

@NotNull
private static ExtensionsAreaImpl createRootArea() {
    ExtensionsAreaImpl rootArea = new ExtensionsAreaImpl(null, null, null, ourLogger);
    rootArea.registerExtensionPoint(AREA_LISTENER_EXTENSION_POINT.getName(), AreaListener.class.getName());
    return rootArea;
}
Also used : ExtensionsAreaImpl(com.intellij.openapi.extensions.impl.ExtensionsAreaImpl) NotNull(org.jetbrains.annotations.NotNull)

Example 3 with ExtensionsAreaImpl

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

the class Extensions method instantiateArea.

public static void instantiateArea(@NonNls @NotNull String areaClass, @NotNull AreaInstance areaInstance, @Nullable("null means root") AreaInstance parentAreaInstance) {
    AreaClassConfiguration configuration = ourAreaClass2Configuration.get(areaClass);
    if (configuration == null) {
        throw new IllegalArgumentException("Area class is not registered: " + areaClass);
    }
    ExtensionsArea parentArea = getArea(parentAreaInstance);
    if (!equals(parentArea.getAreaClass(), configuration.getParentClassName())) {
        throw new IllegalArgumentException("Wrong parent area. Expected class: " + configuration.getParentClassName() + " actual class: " + parentArea.getAreaClass());
    }
    ExtensionsAreaImpl area = new ExtensionsAreaImpl(areaClass, areaInstance, parentArea.getPicoContainer(), ourLogger);
    if (ourAreaInstance2area.put(areaInstance, area) != null) {
        throw new IllegalArgumentException("Area already instantiated for: " + areaInstance);
    }
    for (AreaListener listener : getAreaListeners()) {
        listener.areaCreated(areaClass, areaInstance);
    }
}
Also used : ExtensionsAreaImpl(com.intellij.openapi.extensions.impl.ExtensionsAreaImpl)

Aggregations

ExtensionsAreaImpl (com.intellij.openapi.extensions.impl.ExtensionsAreaImpl)3 Disposable (com.intellij.openapi.Disposable)1 NotNull (org.jetbrains.annotations.NotNull)1 TestOnly (org.jetbrains.annotations.TestOnly)1