本文整理汇总了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;
}
示例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()]);
}
示例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;
}
示例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()]);
}
示例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);
}
示例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()]);
}