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


Java ChangeVariableTypeQuickFixProvider类代码示例

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


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

示例1: getChangeVariableTypeFixes

import com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider; //导入依赖的package包/类
@NotNull
public static List<IntentionAction> getChangeVariableTypeFixes(@NotNull PsiVariable parameter, PsiType itemType)
{
	if(itemType instanceof PsiMethodReferenceType)
	{
		return Collections.emptyList();
	}
	List<IntentionAction> result = new ArrayList<>();
	if(itemType != null)
	{
		for(ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME))
		{
			Collections.addAll(result, fixProvider.getFixes(parameter, itemType));
		}
	}
	IntentionAction changeFix = getChangeParameterClassFix(parameter.getType(), itemType);
	if(changeFix != null)
	{
		result.add(changeFix);
	}
	return result;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:23,代码来源:HighlightUtil.java

示例2: getChangeVariableTypeFixes

import com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider; //导入依赖的package包/类
public static LocalQuickFix[] getChangeVariableTypeFixes(@NotNull PsiVariable parameter, PsiType itemType) {
  if (itemType instanceof PsiMethodReferenceType) return LocalQuickFix.EMPTY_ARRAY;
  final List<LocalQuickFix> result = new ArrayList<LocalQuickFix>();
  LOG.assertTrue(parameter.isValid());
  if (itemType != null) {
    for (ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME)) {
      for (IntentionAction action : fixProvider.getFixes(parameter, itemType)) {
        if (action instanceof LocalQuickFix) {
          result.add((LocalQuickFix)action);
        }
      }
    }
  }
  return result.toArray(new LocalQuickFix[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:UncheckedWarningLocalInspectionBase.java

示例3: getChangeVariableTypeFixes

import com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider; //导入依赖的package包/类
@NotNull
public static List<IntentionAction> getChangeVariableTypeFixes(@NotNull PsiVariable parameter, PsiType itemType) {
  if (itemType instanceof PsiMethodReferenceType) return Collections.emptyList();
  List<IntentionAction> result = new ArrayList<IntentionAction>();
  if (itemType != null) {
    for (ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME)) {
      Collections.addAll(result, fixProvider.getFixes(parameter, itemType));
    }
  }
  IntentionAction changeFix = getChangeParameterClassFix(parameter.getType(), itemType);
  if (changeFix != null) result.add(changeFix);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:HighlightUtil.java

示例4: getChangeVariableTypeFixes

import com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider; //导入依赖的package包/类
public static LocalQuickFix[] getChangeVariableTypeFixes(PsiVariable parameter, PsiType itemType) {
  if (itemType instanceof PsiMethodReferenceType) return LocalQuickFix.EMPTY_ARRAY;
  final List<LocalQuickFix> result = new ArrayList<LocalQuickFix>();
  LOG.assertTrue(parameter.isValid());
  for (ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME)) {
    for (IntentionAction action : fixProvider.getFixes(parameter, itemType)) {
      if (action instanceof LocalQuickFix) {
        result.add((LocalQuickFix)action);
      }
    }
  }
  return result.toArray(new LocalQuickFix[result.size()]);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:UncheckedWarningLocalInspection.java

示例5: registerChangeVariableTypeFixes

import com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider; //导入依赖的package包/类
public static void registerChangeVariableTypeFixes(PsiVariable parameter, PsiType itemType, HighlightInfo highlightInfo) {
  if (itemType instanceof PsiMethodReferenceType) return;
  for (ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME)) {
    for (IntentionAction action : fixProvider.getFixes(parameter, itemType)) {
      QuickFixAction.registerQuickFixAction(highlightInfo, action);
    }
  }
  ChangeParameterClassFix.registerQuickFixAction(parameter.getType(), itemType, highlightInfo);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:HighlightUtil.java

示例6: getChangeVariableTypeFixes

import com.intellij.codeInsight.quickfix.ChangeVariableTypeQuickFixProvider; //导入依赖的package包/类
@NotNull
private static LocalQuickFix[] getChangeVariableTypeFixes(@NotNull PsiVariable parameter, @Nullable PsiType itemType, LocalQuickFix[] generifyFixes)
{
	if(itemType instanceof PsiMethodReferenceType)
	{
		return generifyFixes;
	}
	LOG.assertTrue(parameter.isValid());
	final List<LocalQuickFix> result = new ArrayList<>();
	if(itemType != null)
	{
		for(ChangeVariableTypeQuickFixProvider fixProvider : Extensions.getExtensions(ChangeVariableTypeQuickFixProvider.EP_NAME))
		{
			for(IntentionAction action : fixProvider.getFixes(parameter, itemType))
			{
				if(action instanceof LocalQuickFix)
				{
					result.add((LocalQuickFix) action);
				}
			}
		}
	}

	if(generifyFixes.length > 0)
	{
		Collections.addAll(result, generifyFixes);
	}
	return result.toArray(new LocalQuickFix[result.size()]);
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:30,代码来源:UncheckedWarningLocalInspectionBase.java


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