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