com.intellij.openapi.extensions.ExtensionsArea Java Examples

The following examples show how to use com.intellij.openapi.extensions.ExtensionsArea. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ServiceHelper.java    From intellij with Apache License 2.0 5 votes vote down vote up
public static <T> void registerExtensionPoint(
    ExtensionPointName<T> name, Class<T> clazz, Disposable parentDisposable) {
  ExtensionsArea area = Extensions.getRootArea();
  String epName = name.getName();
  area.registerExtensionPoint(epName, clazz.getName());
  Disposer.register(parentDisposable, () -> area.unregisterExtensionPoint(epName));
}
 
Example #2
Source File: CppSupportLoader.java    From CppTools with Apache License 2.0 5 votes vote down vote up
public static void doRegisterExtensionPoint(String extensionPointName, Object extension, Project project) {
  // Dynamic registering exp point for IDEA 7
  ExtensionsArea area = project != null ? Extensions.getArea(project): Extensions.getRootArea();
  if (area != null && area.hasExtensionPoint(extensionPointName)) {
    area.getExtensionPoint(extensionPointName).registerExtension(extension, LoadingOrder.ANY);
  }
}
 
Example #3
Source File: JavaAnalyzer.java    From java2typescript with Apache License 2.0 4 votes vote down vote up
public JavaAnalyzer() {
    Disposable d = () -> {
    };

    CoreApplicationEnvironment.registerExtensionPoint(Extensions.getRootArea(), ClsCustomNavigationPolicy.EP_NAME, ClsCustomNavigationPolicy.class);



    ExtensionsArea area = Extensions.getRootArea();
    CoreApplicationEnvironment.registerExtensionPoint(area, BinaryFileStubBuilders.EP_NAME, FileTypeExtensionPoint.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, FileContextProvider.EP_NAME, FileContextProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, MetaDataContributor.EP_NAME, MetaDataContributor.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, PsiAugmentProvider.EP_NAME, PsiAugmentProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, JavaMainMethodProvider.EP_NAME, JavaMainMethodProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, ContainerProvider.EP_NAME, ContainerProvider.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, ClassFileDecompilers.EP_NAME, ClassFileDecompilers.Decompiler.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, TypeAnnotationModifier.EP_NAME, TypeAnnotationModifier.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, MetaLanguage.EP_NAME, MetaLanguage.class);
    CoreApplicationEnvironment.registerExtensionPoint(area, JavaModuleSystem.EP_NAME, JavaModuleSystem.class);

    CoreApplicationEnvironment.registerApplicationExtensionPoint(ContainerProvider.EP_NAME, JavaContainerProvider.class);

    appEnvironment = new JavaCoreApplicationEnvironment(d);
    appEnvironment.registerApplicationService(JavaClassSupers.class, new JavaClassSupersImpl());

    javaEnvironment = new JavaCoreProjectEnvironment(d, appEnvironment) {
        @Override
        protected void preregisterServices() {
            ExtensionsArea a = Extensions.getArea(myProject);
            CoreApplicationEnvironment.registerExtensionPoint(a, PsiTreeChangePreprocessor.EP_NAME, PsiTreeChangePreprocessor.class);
            CoreApplicationEnvironment.registerExtensionPoint(a, PsiElementFinder.EP_NAME, PsiElementFinder.class);
            CoreApplicationEnvironment.registerExtensionPoint(a, JvmElementProvider.EP_NAME, JvmElementProvider.class);
        }
        @Override
        protected void registerJavaPsiFacade() {
            JavaFileManager javaFileManager = getProject().getComponent(JavaFileManager.class);
            CoreJavaFileManager coreJavaFileManager = (CoreJavaFileManager) javaFileManager;
            ServiceManager.getService(getProject(), CoreJavaFileManager.class);
            getProject().registerService(CoreJavaFileManager.class, coreJavaFileManager);
            getProject().registerService(PsiNameHelper.class, PsiNameHelperImpl.getInstance());
            PsiElementFinder finder = new PsiElementFinderImpl(getProject(), coreJavaFileManager);
            ExtensionsArea area = Extensions.getArea(getProject());
            area.getExtensionPoint(PsiElementFinder.EP_NAME).registerExtension(finder);
            super.registerJavaPsiFacade();
        }
    };
    System.setProperty("idea.use.native.fs.for.win", "false");
}
 
Example #4
Source File: StringUtilsTest.java    From EclipseCodeFormatter with Apache License 2.0 4 votes vote down vote up
@NotNull
@Override
public ExtensionsArea getExtensionArea() {
	return null;
}