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


Java PsiMultiReference.getReferences方法代码示例

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


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

示例1: findFileReference

import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; //导入方法依赖的package包/类
@Nullable
public static FileReference findFileReference(@NotNull final PsiReference original) {
  if (original instanceof PsiMultiReference) {
    final PsiMultiReference multiReference = (PsiMultiReference)original;
    for (PsiReference reference : multiReference.getReferences()) {
      if (reference instanceof FileReference) {
        return (FileReference)reference;
      }
    }
  }
  else if (original instanceof FileReferenceOwner) {
    final PsiFileReference fileReference = ((FileReferenceOwner)original).getLastFileReference();
    if (fileReference instanceof FileReference) {
      return (FileReference)fileReference;
    }
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:FileReference.java

示例2: getReference

import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; //导入方法依赖的package包/类
@Nullable
private static Pair<FileReference, Boolean> getReference(final PsiReference original) {
  if (original == null) {
    return null;
  }

  if (original instanceof PsiMultiReference) {
    final PsiMultiReference multiReference = (PsiMultiReference)original;
    for (PsiReference reference : multiReference.getReferences()) {
      if (reference instanceof FileReference) {
        return Pair.create((FileReference) reference, false);
      }
    }
  }
  else if (original instanceof FileReferenceOwner) {
    final PsiFileReference fileReference = ((FileReferenceOwner)original).getLastFileReference();
    if (fileReference instanceof FileReference) {
      return Pair.create((FileReference) fileReference, true);
    }
  }

  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:FilePathCompletionContributor.java

示例3: findFileReference

import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; //导入方法依赖的package包/类
@Nullable
private static FileReference findFileReference(@NotNull final PsiReference original) {
  if (original instanceof PsiMultiReference) {
    final PsiMultiReference multiReference = (PsiMultiReference)original;
    for (PsiReference reference : multiReference.getReferences()) {
      if (reference instanceof FileReference) {
        return (FileReference)reference;
      }
    }
  }
  else if (original instanceof FileReferenceOwner) {
    final PsiFileReference fileReference = ((FileReferenceOwner)original).getLastFileReference();
    if (fileReference instanceof FileReference) {
      return (FileReference)fileReference;
    }
  }

  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:ConvertAbsolutePathToRelativeIntentionAction.java

示例4: findFileReference

import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; //导入方法依赖的package包/类
@Nullable
public static FileReference findFileReference(@Nonnull final PsiReference original) {
  if (original instanceof PsiMultiReference) {
    final PsiMultiReference multiReference = (PsiMultiReference)original;
    for (PsiReference reference : multiReference.getReferences()) {
      if (reference instanceof FileReference) {
        return (FileReference)reference;
      }
    }
  }
  else if (original instanceof FileReferenceOwner) {
    final PsiFileReference fileReference = ((FileReferenceOwner)original).getLastFileReference();
    if (fileReference instanceof FileReference) {
      return (FileReference)fileReference;
    }
  }

  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:FileReference.java

示例5: getReferences

import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; //导入方法依赖的package包/类
protected static PsiReference[] getReferences(final PsiMultiReference multiReference) {
  final PsiReference[] references = multiReference.getReferences();
  final List<PsiReference> hard = ContainerUtil.findAll(references, new Condition<PsiReference>() {
    @Override
    public boolean value(final PsiReference object) {
      return !object.isSoft();
    }
  });
  if (!hard.isEmpty()) {
    return hard.toArray(new PsiReference[hard.size()]);
  }
  return references;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:CompletionData.java

示例6: getReferences

import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; //导入方法依赖的package包/类
protected static PsiReference[] getReferences(final PsiMultiReference multiReference) {
  final PsiReference[] references = multiReference.getReferences();
  final List<PsiReference> hard = ContainerUtil.findAll(references, object -> !object.isSoft());
  if (!hard.isEmpty()) {
    return hard.toArray(new PsiReference[hard.size()]);
  }
  return references;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:CompletionData.java

示例7: getReference

import com.intellij.psi.impl.source.resolve.reference.impl.PsiMultiReference; //导入方法依赖的package包/类
@Nullable
private static Pair<FileReference, Boolean> getReference(final PsiReference original) {
  if (original == null) {
    return null;
  }

  if (original instanceof PsiMultiReference) {
    final PsiMultiReference multiReference = (PsiMultiReference)original;
    for (PsiReference reference : multiReference.getReferences()) {
      if (reference instanceof FileReference) {
        if (((FileReference)reference).getFileReferenceSet().supportsExtendedCompletion()) {
          return Pair.create((FileReference)reference, false);
        }
      }
    }
  }
  else if (original instanceof FileReferenceOwner) {
    final PsiFileReference fileReference = ((FileReferenceOwner)original).getLastFileReference();
    if (fileReference instanceof FileReference) {
      if (((FileReference)fileReference).getFileReferenceSet().supportsExtendedCompletion()) {
        return Pair.create((FileReference)fileReference, true);
      }
    }
  }

  return null;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:FilePathCompletionContributor.java


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