• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java QuickFixActionRegistrar类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.codeInsight.daemon.QuickFixActionRegistrar的典型用法代码示例。如果您正苦于以下问题:Java QuickFixActionRegistrar类的具体用法?Java QuickFixActionRegistrar怎么用?Java QuickFixActionRegistrar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



QuickFixActionRegistrar类属于com.intellij.codeInsight.daemon包,在下文中一共展示了QuickFixActionRegistrar类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: registerPriorityActions

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
private static void registerPriorityActions(@NotNull QuickFixActionRegistrar registrar,
                                            @NotNull TextRange fixRange,
                                            @NotNull PsiReferenceExpression refExpr) {
  final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(refExpr.getProject());

  final Map<VariableKind, IntentionAction> map = new EnumMap<VariableKind, IntentionAction>(VariableKind.class);
  map.put(VariableKind.FIELD, new CreateFieldFromUsageFix(refExpr));
  map.put(VariableKind.STATIC_FINAL_FIELD, new CreateConstantFieldFromUsageFix(refExpr));
  if (!refExpr.isQualified()) {
    map.put(VariableKind.LOCAL_VARIABLE, new CreateLocalFromUsageFix(refExpr));
    map.put(VariableKind.PARAMETER, new CreateParameterFromUsageFix(refExpr));
  }

  final VariableKind kind = getKind(styleManager, refExpr);
  if (map.containsKey(kind)) {
    map.put(kind, PriorityIntentionActionWrapper.highPriority(map.get(kind)));
  }

  for (IntentionAction action : map.values()) {
    registrar.register(fixRange, action, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:DefaultQuickFixProvider.java


示例2: registerPriorityActions

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
private static void registerPriorityActions(@NotNull QuickFixActionRegistrar registrar,
                                            @NotNull TextRange fixRange,
                                            @NotNull PsiReferenceExpression refExpr) {
  final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(refExpr.getProject());

  final Map<VariableKind, IntentionAction> map = new HashMap<VariableKind, IntentionAction>();
  map.put(VariableKind.FIELD, new CreateFieldFromUsageFix(refExpr));
  map.put(VariableKind.STATIC_FINAL_FIELD, new CreateConstantFieldFromUsageFix(refExpr));
  if (!refExpr.isQualified()) {
    map.put(VariableKind.LOCAL_VARIABLE, new CreateLocalFromUsageFix(refExpr));
    map.put(VariableKind.PARAMETER, new CreateParameterFromUsageFix(refExpr));
  }

  final VariableKind kind = getKind(styleManager, refExpr);
  if (map.containsKey(kind)) {
    map.put(kind, PriorityIntentionActionWrapper.highPriority(map.get(kind)));
  }

  for (IntentionAction action : map.values()) {
    registrar.register(fixRange, action, null);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:DefaultQuickFixProvider.java


示例3: registerPriorityActions

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
private static void registerPriorityActions(@NotNull QuickFixActionRegistrar registrar, @NotNull TextRange fixRange, @NotNull PsiReferenceExpression refExpr)
{
	final JavaCodeStyleManager styleManager = JavaCodeStyleManager.getInstance(refExpr.getProject());

	final Map<VariableKind, IntentionAction> map = new EnumMap<>(VariableKind.class);
	map.put(VariableKind.FIELD, new CreateFieldFromUsageFix(refExpr));
	map.put(VariableKind.STATIC_FINAL_FIELD, new CreateConstantFieldFromUsageFix(refExpr));
	if(!refExpr.isQualified())
	{
		map.put(VariableKind.LOCAL_VARIABLE, new CreateLocalFromUsageFix(refExpr));
		map.put(VariableKind.PARAMETER, new CreateParameterFromUsageFix(refExpr));
	}

	final VariableKind kind = getKind(styleManager, refExpr);
	if(map.containsKey(kind))
	{
		map.put(kind, PriorityIntentionActionWrapper.highPriority(map.get(kind)));
	}

	for(IntentionAction action : map.values())
	{
		registrar.register(fixRange, action, null);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:DefaultQuickFixProvider.java


示例4: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
public static void registerFixes(QuickFixActionRegistrar registrar, final PsiJavaCodeReferenceElement reference) {
  final PsiElement psiElement = reference.getElement();
  @NonNls final String referenceName = reference.getRangeInElement().substring(psiElement.getText());
  Project project = psiElement.getProject();
  final PsiFile containingFile = psiElement.getContainingFile();
  if (containingFile == null) return;
  PsiDirectory dir = containingFile.getContainingDirectory();
  if (dir == null) return;

  VirtualFile classVFile = containingFile.getVirtualFile();
  if (classVFile == null) return;

  final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  final Module currentModule = fileIndex.getModuleForFile(classVFile);
  if (currentModule == null) return;
  List<VirtualFile> sourceRoots = ModuleRootManager.getInstance(currentModule).getSourceRoots(JavaModuleSourceRootTypes.SOURCES);
  if (sourceRoots.isEmpty()) return;
  final PsiDirectory sourceDirectory = PsiManager.getInstance(project).findDirectory(sourceRoots.get(0));
  if (sourceDirectory == null) return;

  VirtualFile vsourceRoot = fileIndex.getSourceRootForFile(classVFile);
  if (vsourceRoot == null) return;
  final PsiDirectory sourceRoot = PsiManager.getInstance(project).findDirectory(vsourceRoot);
  if (sourceRoot == null) return;

  registrar.register(new MoveClassToModuleFix(referenceName, currentModule, sourceRoot, psiElement));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:MoveClassToModuleFix.java


示例5: registerReferenceFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
public static <T extends PsiReference> void registerReferenceFixes(@NotNull T ref, @NotNull QuickFixActionRegistrar registrar) {
  final boolean dumb = DumbService.getInstance(ref.getElement().getProject()).isDumb();
  UnresolvedReferenceQuickFixProvider[] fixProviders = Extensions.getExtensions(EXTENSION_NAME);
  Class<? extends PsiReference> referenceClass = ref.getClass();
  for (UnresolvedReferenceQuickFixProvider each : fixProviders) {
    if (dumb && !DumbService.isDumbAware(each)) {
      continue;
    }
    if (ReflectionUtil.isAssignable(each.getReferenceClass(), referenceClass)) {
      each.registerFixes(ref, registrar);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:UnresolvedReferenceQuickFixProvider.java


示例6: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(@NotNull URLReference ref, @NotNull QuickFixActionRegistrar registrar) {
  registrar.register(new FetchExtResourceAction());
  registrar.register(new ManuallySetupExtResourceAction());
  registrar.register(new IgnoreExtResourceAction());

  final PsiElement parentElement = ref.getElement().getParent();
  if (parentElement instanceof XmlAttribute && ((XmlAttribute)parentElement).isNamespaceDeclaration()) {
    registrar.register(new AddXsiSchemaLocationForExtResourceAction());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:URLReferenceQuickFixProvider.java


示例7: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(@NotNull TypeOrElementOrAttributeReference ref, @NotNull QuickFixActionRegistrar registrar) {
  if (ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.TypeReference) {
    registrar.register(
      new CreateXmlElementIntentionAction("xml.schema.create.complex.type.intention.name", SchemaReferencesProvider.COMPLEX_TYPE_TAG_NAME, ref)
    );
    registrar.register(
      new CreateXmlElementIntentionAction("xml.schema.create.simple.type.intention.name", SchemaReferencesProvider.SIMPLE_TYPE_TAG_NAME, ref)
    );
  }
  else if (ref.getType() != null) {
    @PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String key = null;
    @NonNls String declarationTagName = null;

    if (ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.ElementReference) {
      declarationTagName = SchemaReferencesProvider.ELEMENT_TAG_NAME;
      key = "xml.schema.create.element.intention.name";
    } else if (ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.AttributeReference) {
      declarationTagName = SchemaReferencesProvider.ATTRIBUTE_TAG_NAME;
      key = "xml.schema.create.attribute.intention.name";
    } else if (ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.AttributeGroupReference) {
      declarationTagName = SchemaReferencesProvider.ATTRIBUTE_GROUP_TAG_NAME;
      key = "xml.schema.create.attribute.group.intention.name";
    } else if (ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.GroupReference) {
      declarationTagName = SchemaReferencesProvider.GROUP_TAG_NAME;
      key = "xml.schema.create.group.intention.name";
    }

    assert key != null;
    registrar.register(new CreateXmlElementIntentionAction(key, declarationTagName, ref));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:SchemaReferenceQuickFixProvider.java


示例8: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(@NotNull PsiJavaCodeReferenceElement ref, @NotNull QuickFixActionRegistrar registrar) {
  final Module module = ModuleUtilCore.findModuleForPsiElement(ref);
  if (module != null && isSuspectedName(getFQTypeName(ref))) {
    registrar.register(new RepositoryAddLibraryAction(module, getLibraryDescription()));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:RepositoryUnresolvedReferenceQuickFixProvider.java


示例9: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(@NotNull final JavaFxEventHandlerReference ref, @NotNull final QuickFixActionRegistrar registrar) {
  if (ref.myController != null && ref.myEventHandler == null) {
    final CreateMethodQuickFix quickFix = CreateMethodQuickFix.createFix(ref.myController, getHandlerSignature(ref), "");
    if (quickFix != null) {
      registrar.register(quickFix);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:JavaFxEventHandlerReference.java


示例10: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(PsiJavaCodeReferenceElement ref, QuickFixActionRegistrar registrar) {
    if(importAll == null) {
        importAll = ATService.getInstance().getState().importAllEnabled;
    }
    if(importAll) {
        registrar.register(new ImportAll(ref));
    }
}
 
开发者ID:Guichaguri,项目名称:AdditionalTools,代码行数:10,代码来源:QuickFixer.java


示例11: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(@NotNull PsiReference reference, @NotNull QuickFixActionRegistrar registrar) {
  // FIXME: Re-enable quick fix for missing dependencies once it is functional again.
  // https://github.com/pantsbuild/intellij-pants-plugin/issues/280
  if (!ApplicationManager.getApplication().isUnitTestMode()) {
    return;
  }
  for (PantsQuickFix quickFix : PantsUnresolvedReferenceFixFinder.findMissingDependencies(reference)) {
    registrar.register(quickFix);
  }
}
 
开发者ID:pantsbuild,项目名称:intellij-pants-plugin,代码行数:12,代码来源:PantsUnresolvedJavaReferenceQuickFixProvider.java


示例12: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
public static void registerFixes(QuickFixActionRegistrar registrar, final PsiJavaCodeReferenceElement reference) {
  final PsiElement psiElement = reference.getElement();
  @NonNls final String referenceName = reference.getRangeInElement().substring(psiElement.getText());
  Project project = psiElement.getProject();
  final PsiFile containingFile = psiElement.getContainingFile();
  if (containingFile == null) return;
  PsiDirectory dir = containingFile.getContainingDirectory();
  if (dir == null) return;

  VirtualFile classVFile = containingFile.getVirtualFile();
  if (classVFile == null) return;

  final ProjectFileIndex fileIndex = ProjectRootManager.getInstance(project).getFileIndex();
  final Module currentModule = fileIndex.getModuleForFile(classVFile);
  if (currentModule == null) return;
  VirtualFile[] sourceRoots = ModuleRootManager.getInstance(currentModule).getSourceRoots();
  if (sourceRoots.length == 0) return;
  final PsiDirectory sourceDirectory = PsiManager.getInstance(project).findDirectory(sourceRoots[0]);
  if (sourceDirectory == null) return;

  VirtualFile vsourceRoot = fileIndex.getSourceRootForFile(classVFile);
  if (vsourceRoot == null) return;
  final PsiDirectory sourceRoot = PsiManager.getInstance(project).findDirectory(vsourceRoot);
  if (sourceRoot == null) return;

  registrar.register(new MoveClassToModuleFix(referenceName, currentModule, sourceRoot, psiElement));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:MoveClassToModuleFix.java


示例13: registerReferenceFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
public static <T extends PsiReference> void registerReferenceFixes(T ref, QuickFixActionRegistrar registrar) {

    final boolean dumb = DumbService.getInstance(ref.getElement().getProject()).isDumb();
    UnresolvedReferenceQuickFixProvider[] fixProviders = Extensions.getExtensions(EXTENSION_NAME);
    Class<? extends PsiReference> referenceClass = ref.getClass();
    for (UnresolvedReferenceQuickFixProvider each : fixProviders) {
      if (dumb && !DumbService.isDumbAware(each)) {
        continue;
      }
      if (ReflectionCache.isAssignable(each.getReferenceClass(), referenceClass)) {
        each.registerFixes(ref, registrar);
      }
    }
  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:UnresolvedReferenceQuickFixProvider.java


示例14: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(URLReference ref, QuickFixActionRegistrar registrar) {
  registrar.register(new FetchExtResourceAction());
  registrar.register(new ManuallySetupExtResourceAction());
  registrar.register(new IgnoreExtResourceAction());

  final PsiElement parentElement = ref.getElement().getParent();
  if (parentElement instanceof XmlAttribute && ((XmlAttribute)parentElement).isNamespaceDeclaration()) {
    registrar.register(new AddXsiSchemaLocationForExtResourceAction());
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:12,代码来源:URLReferenceQuickFixProvider.java


示例15: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(SchemaReferencesProvider.TypeOrElementOrAttributeReference ref, QuickFixActionRegistrar registrar) {
  if (ref.getType() == SchemaReferencesProvider.TypeOrElementOrAttributeReference.ReferenceType.TypeReference) {
    registrar.register(
      new CreateXmlElementIntentionAction("xml.schema.create.complex.type.intention.name", SchemaReferencesProvider.COMPLEX_TYPE_TAG_NAME, ref)
    );
    registrar.register(
      new CreateXmlElementIntentionAction("xml.schema.create.simple.type.intention.name", SchemaReferencesProvider.SIMPLE_TYPE_TAG_NAME, ref)
    );
  }
  else if (ref.getType() != null) {
    @PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String key = null;
    @NonNls String declarationTagName = null;

    if (ref.getType() == SchemaReferencesProvider.TypeOrElementOrAttributeReference.ReferenceType.ElementReference) {
      declarationTagName = SchemaReferencesProvider.ELEMENT_TAG_NAME;
      key = "xml.schema.create.element.intention.name";
    } else if (ref.getType() == SchemaReferencesProvider.TypeOrElementOrAttributeReference.ReferenceType.AttributeReference) {
      declarationTagName = SchemaReferencesProvider.ATTRIBUTE_TAG_NAME;
      key = "xml.schema.create.attribute.intention.name";
    } else if (ref.getType() == SchemaReferencesProvider.TypeOrElementOrAttributeReference.ReferenceType.AttributeGroupReference) {
      declarationTagName = SchemaReferencesProvider.ATTRIBUTE_GROUP_TAG_NAME;
      key = "xml.schema.create.attribute.group.intention.name";
    } else if (ref.getType() == SchemaReferencesProvider.TypeOrElementOrAttributeReference.ReferenceType.GroupReference) {
      declarationTagName = SchemaReferencesProvider.GROUP_TAG_NAME;
      key = "xml.schema.create.group.intention.name";
    }

    assert key != null && declarationTagName != null;
    registrar.register(new CreateXmlElementIntentionAction(key, declarationTagName, ref));
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:SchemaReferenceQuickFixProvider.java


示例16: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(final JavaFxEventHandlerReference ref, final QuickFixActionRegistrar registrar) {
  if (ref.myController != null && ref.myEventHandler == null) {
    final CreateMethodQuickFix quickFix = CreateMethodQuickFix.createFix(ref.myController, getHandlerSignature(ref), "");
    if (quickFix != null) {
      registrar.register(quickFix);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:JavaFxEventHandlerReference.java


示例17: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
@RequiredReadAction
public void registerFixes(CSharpReferenceExpression expression, QuickFixActionRegistrar quickFixActionRegistrar)
{
	if(UsingNamespaceFix.isValidReference(expression.kind(), expression))
	{
		quickFixActionRegistrar.register(new UsingNamespaceFix(expression));
	}

	CSharpLambdaResolveResult lambdaResolveResult = null;
	List<ExpectedTypeInfo> expectedTypeRefs = ExpectedTypeVisitor.findExpectedTypeRefs(expression);
	for(ExpectedTypeInfo expectedTypeRef : expectedTypeRefs)
	{
		DotNetTypeRef typeRef = expectedTypeRef.getTypeRef();
		DotNetTypeResolveResult result = typeRef.resolve();
		if(result instanceof CSharpLambdaResolveResult)
		{
			lambdaResolveResult = (CSharpLambdaResolveResult) result;
			break;
		}
	}

	if(lambdaResolveResult != null)
	{
		quickFixActionRegistrar.register(new CreateUnresolvedMethodByLambdaTypeFix(expression, lambdaResolveResult));
	}
	else
	{
		quickFixActionRegistrar.register(new CreateUnresolvedMethodFix(expression));
		quickFixActionRegistrar.register(new CreateUnresolvedFieldFix(expression));
		quickFixActionRegistrar.register(new CreateUnresolvedPropertyFix(expression));
		quickFixActionRegistrar.register(new CreateUnresolvedEventFix(expression));
	}
}
 
开发者ID:consulo,项目名称:consulo-csharp,代码行数:35,代码来源:CSharpUnresolvedReferenceQuickFixProvider.java


示例18: registerReferenceFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
public static <T extends PsiReference> void registerReferenceFixes(T ref, QuickFixActionRegistrar registrar) {

    final boolean dumb = DumbService.getInstance(ref.getElement().getProject()).isDumb();
    UnresolvedReferenceQuickFixProvider[] fixProviders = Extensions.getExtensions(EXTENSION_NAME);
    Class<? extends PsiReference> referenceClass = ref.getClass();
    for (UnresolvedReferenceQuickFixProvider each : fixProviders) {
      if (dumb && !DumbService.isDumbAware(each)) {
        continue;
      }
      if (ReflectionUtil.isAssignable(each.getReferenceClass(), referenceClass)) {
        each.registerFixes(ref, registrar);
      }
    }
  }
 
开发者ID:consulo,项目名称:consulo,代码行数:15,代码来源:UnresolvedReferenceQuickFixProvider.java


示例19: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(@NotNull URLReference ref, @NotNull QuickFixActionRegistrar registrar)
{
	registrar.register(new FetchExtResourceAction());
	registrar.register(new ManuallySetupExtResourceAction());
	registrar.register(new IgnoreExtResourceAction());

	final PsiElement parentElement = ref.getElement().getParent();
	if(parentElement instanceof XmlAttribute && ((XmlAttribute) parentElement).isNamespaceDeclaration())
	{
		registrar.register(new AddXsiSchemaLocationForExtResourceAction());
	}
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:14,代码来源:URLReferenceQuickFixProvider.java


示例20: registerFixes

import com.intellij.codeInsight.daemon.QuickFixActionRegistrar; //导入依赖的package包/类
@Override
public void registerFixes(@NotNull TypeOrElementOrAttributeReference ref, @NotNull QuickFixActionRegistrar registrar)
{
	if(ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.TypeReference)
	{
		registrar.register(new CreateXmlElementIntentionAction("xml.schema.create.complex.type.intention.name", SchemaReferencesProvider.COMPLEX_TYPE_TAG_NAME, ref));
		registrar.register(new CreateXmlElementIntentionAction("xml.schema.create.simple.type.intention.name", SchemaReferencesProvider.SIMPLE_TYPE_TAG_NAME, ref));
	}
	else if(ref.getType() != null)
	{
		@PropertyKey(resourceBundle = XmlBundle.PATH_TO_BUNDLE) String key = null;
		@NonNls String declarationTagName = null;

		if(ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.ElementReference)
		{
			declarationTagName = SchemaReferencesProvider.ELEMENT_TAG_NAME;
			key = "xml.schema.create.element.intention.name";
		}
		else if(ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.AttributeReference)
		{
			declarationTagName = SchemaReferencesProvider.ATTRIBUTE_TAG_NAME;
			key = "xml.schema.create.attribute.intention.name";
		}
		else if(ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.AttributeGroupReference)
		{
			declarationTagName = SchemaReferencesProvider.ATTRIBUTE_GROUP_TAG_NAME;
			key = "xml.schema.create.attribute.group.intention.name";
		}
		else if(ref.getType() == TypeOrElementOrAttributeReference.ReferenceType.GroupReference)
		{
			declarationTagName = SchemaReferencesProvider.GROUP_TAG_NAME;
			key = "xml.schema.create.group.intention.name";
		}

		assert key != null;
		registrar.register(new CreateXmlElementIntentionAction(key, declarationTagName, ref));
	}
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:39,代码来源:SchemaReferenceQuickFixProvider.java



注:本文中的com.intellij.codeInsight.daemon.QuickFixActionRegistrar类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Decorations类代码示例发布时间:2022-05-22
下一篇:
Java HelixConfigScope类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap