本文整理汇总了Java中com.intellij.psi.search.searches.DefinitionsSearch类的典型用法代码示例。如果您正苦于以下问题:Java DefinitionsSearch类的具体用法?Java DefinitionsSearch怎么用?Java DefinitionsSearch使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefinitionsSearch类属于com.intellij.psi.search.searches包,在下文中一共展示了DefinitionsSearch类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchDefinitions
import com.intellij.psi.search.searches.DefinitionsSearch; //导入依赖的package包/类
@Nullable("For the case the search has been cancelled")
protected PsiElement[] searchDefinitions(final PsiElement element) {
final PsiElement[][] result = new PsiElement[1][];
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
try {
result[0] = DefinitionsSearch.search(element).toArray(PsiElement.EMPTY_ARRAY);
}
catch (IndexNotReadyException e) {
dumbModeNotification(element);
result[0] = null;
}
}
}, SEARCHING_FOR_IMPLEMENTATIONS, true, element.getProject())) {
return null;
}
return result[0];
}
示例2: update
import com.intellij.psi.search.searches.DefinitionsSearch; //导入依赖的package包/类
@Override
public void update(final AnActionEvent event) {
if (!DefinitionsSearch.INSTANCE.hasAnyExecutors()) {
event.getPresentation().setVisible(false);
}
else {
super.update(event);
}
}
示例3: getItemsByQName
import com.intellij.psi.search.searches.DefinitionsSearch; //导入依赖的package包/类
public static List<HaxeClass> getItemsByQName(final HaxeClass haxeClass) {
final List<HaxeClass> result = new ArrayList<HaxeClass>();
DefinitionsSearch.search(haxeClass).forEach(new Processor<PsiElement>() {
@Override
public boolean process(PsiElement element) {
if (element instanceof HaxeClass) {
result.add((HaxeClass)element);
}
return true;
}
});
return result;
}