当前位置: 首页>>代码示例>>Java>>正文


Java JavaClassReferenceProvider.setOption方法代码示例

本文整理汇总了Java中com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider.setOption方法的典型用法代码示例。如果您正苦于以下问题:Java JavaClassReferenceProvider.setOption方法的具体用法?Java JavaClassReferenceProvider.setOption怎么用?Java JavaClassReferenceProvider.setOption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider的用法示例。


在下文中一共展示了JavaClassReferenceProvider.setOption方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createJavaClassReferenceProvider

import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider; //导入方法依赖的package包/类
public static JavaClassReferenceProvider createJavaClassReferenceProvider(final GenericDomValue genericDomValue,
                                                                          ExtendClass extendClass,
                                                                          final JavaClassReferenceProvider provider) {

  if (extendClass != null) {
    if (StringUtil.isNotEmpty(extendClass.value())) {
      provider.setOption(JavaClassReferenceProvider.EXTEND_CLASS_NAMES, new String[]{extendClass.value()});
    }
    if (extendClass.instantiatable()) {
      provider.setOption(JavaClassReferenceProvider.INSTANTIATABLE, Boolean.TRUE);
    }
    if (!extendClass.allowAbstract()) {
      provider.setOption(JavaClassReferenceProvider.CONCRETE, Boolean.TRUE);
    }
    if (!extendClass.allowInterface()) {
      provider.setOption(JavaClassReferenceProvider.NOT_INTERFACE, Boolean.TRUE);
    }
    if (!extendClass.allowEnum()) {
      provider.setOption(JavaClassReferenceProvider.NOT_ENUM, Boolean.TRUE);
    }
    if (extendClass.jvmFormat()) {
      provider.setOption(JavaClassReferenceProvider.JVM_FORMAT, Boolean.TRUE);
    }
    provider.setAllowEmpty(extendClass.allowEmpty());
  }

  ClassTemplate template = genericDomValue.getAnnotation(ClassTemplate.class);
  if (template != null) {
    if (StringUtil.isNotEmpty(template.value())) {
      provider.setOption(JavaClassReferenceProvider.CLASS_TEMPLATE, template.value());
    }
    provider.setOption(JavaClassReferenceProvider.CLASS_KIND, template.kind());
  }

  provider.setSoft(true);
  return provider;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:PsiClassConverter.java

示例2: createClassReferenceProvider

import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider; //导入方法依赖的package包/类
@Override
protected JavaClassReferenceProvider createClassReferenceProvider(GenericDomValue<PsiClass> genericDomValue,
                                                                  ConvertContext context,
                                                                  ExtendClass extendClass) {
  final JavaClassReferenceProvider provider = super.createClassReferenceProvider(genericDomValue, context,
                                                                                 extendClass);

  provider.setOption(JavaClassReferenceProvider.CLASS_KIND, ClassKind.ANNOTATION);
  return provider;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:PsiClassConverter.java

示例3: registerReferenceProviders

import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider; //导入方法依赖的package包/类
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(ourTestClassPattern, new JavaClassReferenceProvider());
  registrar.registerReferenceProvider(ourListenerClassPattern, new JavaClassReferenceProvider());

  final JavaClassReferenceProvider methodSelectorProvider = new JavaClassReferenceProvider();
  methodSelectorProvider.setOption(JavaClassReferenceProvider.EXTEND_CLASS_NAMES, new String[]{"org.testng.IMethodSelector"});
  registrar.registerReferenceProvider(ourMethodSelectorPattern, methodSelectorProvider);

  registrar.registerReferenceProvider(ourSuiteFilePattern, new PathListReferenceProvider(){
    @Override
    protected boolean disableNonSlashedPaths() {
      return false;
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:TestNGSuiteReferenceContributor.java

示例4: createClassReferenceProvider

import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider; //导入方法依赖的package包/类
@Override
protected JavaClassReferenceProvider createClassReferenceProvider(GenericDomValue<PsiClass> genericDomValue,
                                                                  ConvertContext context,
                                                                  ExtendClass extendClass) {
  final JavaClassReferenceProvider provider = super.createClassReferenceProvider(genericDomValue, context, extendClass);
  provider.setOption(JavaClassReferenceProvider.JVM_FORMAT, Boolean.TRUE);
  provider.setOption(JavaClassReferenceProvider.ALLOW_DOLLAR_NAMES, Boolean.TRUE);
  return provider;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PluginPsiClassConverter.java

示例5: registerReferenceProviders

import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider; //导入方法依赖的package包/类
@Override
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
  JavaClassReferenceProvider provider = new JavaClassReferenceProvider();
  provider.setOption(JavaClassReferenceProvider.CLASS_KIND, ClassKind.CLASS);
  registrar.registerReferenceProvider(
      JavaClassQualifiedNameReference.PATTERN, new JavaClassReferenceProvider());
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:8,代码来源:JavaClassReferenceContributor.java

示例6: createClassReferenceProvider

import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider; //导入方法依赖的package包/类
@Override
protected JavaClassReferenceProvider createClassReferenceProvider(GenericDomValue<PsiClass> genericDomValue,
                                                                  ConvertContext context,
                                                                  ExtendClass extendClass) {
  final JavaClassReferenceProvider provider = super.createClassReferenceProvider(genericDomValue, context,
                                                                                 extendClass);

  provider.setOption(JavaClassReferenceProvider.CLASS_KIND, ClassKind.ANNOTATION);
  //provider.setOption(JavaClassReferenceProvider.EXTEND_CLASS_NAMES, new String[] {"org.springframework.samples.petclinic.jsr330.Foo"});
  //
  return provider;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:13,代码来源:PsiClassConverter.java

示例7: registerReferenceProviders

import com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider; //导入方法依赖的package包/类
public void registerReferenceProviders(PsiReferenceRegistrar registrar) {
  registrar.registerReferenceProvider(ourTestClassPattern, new JavaClassReferenceProvider());
  registrar.registerReferenceProvider(ourListenerClassPattern, new JavaClassReferenceProvider());

  final JavaClassReferenceProvider methodSelectorProvider = new JavaClassReferenceProvider();
  methodSelectorProvider.setOption(JavaClassReferenceProvider.EXTEND_CLASS_NAMES, new String[]{"org.testng.IMethodSelector"});
  registrar.registerReferenceProvider(ourMethodSelectorPattern, methodSelectorProvider);

  registrar.registerReferenceProvider(ourSuiteFilePattern, new PathListReferenceProvider(){
    @Override
    protected boolean disableNonSlashedPaths() {
      return false;
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:TestNGSuiteReferenceContributor.java


注:本文中的com.intellij.psi.impl.source.resolve.reference.impl.providers.JavaClassReferenceProvider.setOption方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。