本文整理汇总了Java中com.intellij.ide.actions.QualifiedNameProvider类的典型用法代码示例。如果您正苦于以下问题:Java QualifiedNameProvider类的具体用法?Java QualifiedNameProvider怎么用?Java QualifiedNameProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QualifiedNameProvider类属于com.intellij.ide.actions包,在下文中一共展示了QualifiedNameProvider类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getQualifiedNameFromProviders
import com.intellij.ide.actions.QualifiedNameProvider; //导入依赖的package包/类
@Nullable
public static String getQualifiedNameFromProviders(@Nullable com.intellij.psi.PsiElement element) {
if (element == null) return null;
for (QualifiedNameProvider provider : Extensions.getExtensions(QualifiedNameProvider.EP_NAME)) {
String result = provider.getQualifiedName(element);
if (result != null) return result;
}
return null;
}
示例2: findElementByQualifiedName
import com.intellij.ide.actions.QualifiedNameProvider; //导入依赖的package包/类
@Nullable
public static Pair<PsiElement, QualifiedNameProvider> findElementByQualifiedName(@Nullable String qName, @Nonnull Project project) {
QualifiedNameProvider theProvider = null;
PsiElement element = null;
for(QualifiedNameProvider provider: QualifiedNameProvider.EP_NAME.getExtensions()) {
element = provider.qualifiedNameToElement(qName, project);
if (element != null) {
theProvider = provider;
break;
}
}
return theProvider == null ? null : Pair.create(element, theProvider);
}
示例3: getLookupString
import com.intellij.ide.actions.QualifiedNameProvider; //导入依赖的package包/类
@NotNull
@Override
protected String getLookupString(@NotNull Object item) {
if (item instanceof PsiElement) {
for (QualifiedNameProvider provider : Extensions.getExtensions(QualifiedNameProvider.EP_NAME)) {
String result = provider.getQualifiedName((PsiElement)item);
if (result != null) {
return result;
}
}
}
return item.toString();
}