本文整理汇总了Java中com.intellij.psi.search.searches.DefinitionsScopedSearch类的典型用法代码示例。如果您正苦于以下问题:Java DefinitionsScopedSearch类的具体用法?Java DefinitionsScopedSearch怎么用?Java DefinitionsScopedSearch使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DefinitionsScopedSearch类属于com.intellij.psi.search.searches包,在下文中一共展示了DefinitionsScopedSearch类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: searchDefinitions
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Nullable("For the case the search has been cancelled")
protected PsiElement[] searchDefinitions(final PsiElement element, final Editor editor) {
final PsiElement[][] result = new PsiElement[1][];
if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(new Runnable() {
@Override
public void run() {
try {
result[0] = DefinitionsScopedSearch.search(element, getSearchScope(element, editor)).toArray(PsiElement.EMPTY_ARRAY);
}
catch (IndexNotReadyException e) {
dumbModeNotification(element);
result[0] = null;
}
}
}, SEARCHING_FOR_IMPLEMENTATIONS, true, element.getProject())) {
return null;
}
return result[0];
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:ImplementationSearcher.java
示例2: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor<PsiElement> consumer)
{
final PsiElement element = queryParameters.getElement();
if(element instanceof DotNetTypeDeclaration)
{
return TypeInheritorsSearch.search((DotNetTypeDeclaration) element, queryParameters.getScope(), queryParameters.isCheckDeep(), true,
CSharpTransform.INSTANCE).forEach(new Processor<DotNetTypeDeclaration>()
{
@Override
public boolean process(DotNetTypeDeclaration typeDeclaration)
{
return consumer.process(typeDeclaration);
}
});
}
return true;
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:20,代码来源:CSharpTypeImplementationSearcher.java
示例3: getItemsByQName
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
public static List<HaxeClass> getItemsByQName(final HaxeClass haxeClass)
{
final List<HaxeClass> result = new ArrayList<HaxeClass>();
DefinitionsScopedSearch.search(haxeClass).forEach(new Processor<PsiElement>()
{
@Override
public boolean process(PsiElement element)
{
if(element instanceof HaxeClass)
{
result.add((HaxeClass) element);
}
return true;
}
});
return result;
}
开发者ID:consulo,项目名称:consulo-haxe,代码行数:18,代码来源:HaxeInheritanceDefinitionsSearchExecutor.java
示例4: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor<PsiElement> consumer) {
final PsiElement sourceElement = queryParameters.getElement();
if (sourceElement instanceof PsiMethod) {
return processImplementations((PsiMethod)sourceElement, consumer, queryParameters.getScope());
}
return true;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:MethodImplementationsSearch.java
示例5: update
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public void update(final AnActionEvent event) {
if (!DefinitionsScopedSearch.INSTANCE.hasAnyExecutors()) {
event.getPresentation().setVisible(false);
}
else {
super.update(event);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GotoImplementationAction.java
示例6: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor<PsiElement> consumer) {
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>() {
@Override
public Boolean compute() {
final PsiElement source = queryParameters.getElement();
if (!source.isValid()) return true;
if (source instanceof GrAccessorMethod) {
GrField property = ((GrAccessorMethod)source).getProperty();
return consumer.process(property);
}
else {
final SearchScope searchScope = queryParameters.getScope();
if (source instanceof GrMethod) {
GrReflectedMethod[] reflectedMethods = ((GrMethod)source).getReflectedMethods();
for (GrReflectedMethod reflectedMethod : reflectedMethods) {
if (!MethodImplementationsSearch.processImplementations(reflectedMethod, consumer, searchScope)) return false;
}
}
else if (source instanceof GrField) {
for (GrAccessorMethod method : GroovyPropertyUtils.getFieldAccessors((GrField)source)) {
if (!MethodImplementationsSearch.processImplementations(method, consumer, searchScope)) return false;
}
}
}
return true;
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:GroovyImplementationSearch.java
示例7: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor<PsiElement> consumer)
{
PsiElement element = queryParameters.getElement();
if(element instanceof DotNetVirtualImplementOwner)
{
Collection<DotNetVirtualImplementOwner> members = ReadAction.compute(() -> OverrideUtil.collectOverridenMembers((DotNetVirtualImplementOwner) element));
return ContainerUtil.process(members, consumer);
}
return true;
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:12,代码来源:CSharpMethodImplementationsSearcher.java
示例8: update
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@RequiredDispatchThread
@Override
public void update(final AnActionEvent event) {
if (!DefinitionsScopedSearch.INSTANCE.hasAnyExecutors()) {
event.getPresentation().setVisible(false);
}
else {
super.update(event);
}
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:GotoImplementationAction.java
示例9: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@Nonnull DefinitionsScopedSearch.SearchParameters parameters, @Nonnull Processor<PsiElement> consumer) {
PsiElement element = parameters.getElement();
if (element instanceof PomTargetPsiElement) {
final PomTarget target = ((PomTargetPsiElement)element).getTarget();
if (target instanceof PsiTarget) {
if (!consumer.process(((PsiTarget)target).getNavigationElement())) return false;
}
}
return true;
}
开发者ID:consulo,项目名称:consulo,代码行数:12,代码来源:PomDefinitionSearch.java
示例10: getParametersForLookup
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public Object[] getParametersForLookup(final LookupElement item, final ParameterInfoContext context)
{
if(!(item instanceof MutableLookupElement))
{
return null;
}
PsiElement element = item.getPsiElement();
if(element instanceof JSFunction)
{
final JSFunction originalFunction = (JSFunction) element;
final List<JSFunction> lookupItems = new ArrayList<JSFunction>();
Set<String> availableSignatures = new HashSet<String>();
for(PsiElement el : DefinitionsScopedSearch.search(originalFunction))
{
doAddSignature(lookupItems, availableSignatures, el);
}
if(lookupItems.size() == 0)
{
lookupItems.add(originalFunction);
}
return lookupItems.toArray(new Object[lookupItems.size()]);
}
return ArrayUtil.EMPTY_OBJECT_ARRAY;
}
开发者ID:consulo,项目名称:consulo-javascript,代码行数:31,代码来源:JSParameterInfoHandler.java
示例11: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull final Processor<PsiElement> consumer)
{
final PsiElement sourceElement = queryParameters.getElement();
if(sourceElement instanceof PsiMethod)
{
return processImplementations((PsiMethod) sourceElement, consumer, queryParameters.getScope());
}
return true;
}
开发者ID:consulo,项目名称:consulo-java,代码行数:11,代码来源:MethodImplementationsSearch.java
示例12: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor<PsiElement> consumer) {
final PsiElement sourceElement = queryParameters.getElement();
return !(sourceElement instanceof PsiClass) || processImplementations((PsiClass)sourceElement, consumer, queryParameters.getScope());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:ClassImplementationsSearch.java
示例13: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull final DefinitionsScopedSearch.SearchParameters parameters, @NotNull final Processor<PsiElement> consumer)
{
final PsiElement queryParameters = parameters.getElement();
return ApplicationManager.getApplication().runReadAction(new Computable<Boolean>()
{
public Boolean compute()
{
final PsiElement queryParametersParent = queryParameters.getParent();
HaxeNamedComponent haxeNamedComponent;
if(queryParameters instanceof HaxeClass)
{
haxeNamedComponent = (HaxeClass) queryParameters;
}
else if(queryParametersParent instanceof HaxeNamedComponent && queryParameters instanceof HaxeComponentName)
{
haxeNamedComponent = (HaxeNamedComponent) queryParametersParent;
}
else
{
return true;
}
if(haxeNamedComponent instanceof HaxeClass)
{
processInheritors(((HaxeClass) haxeNamedComponent).getQualifiedName(), queryParameters, consumer);
}
else if(HaxeComponentType.typeOf(haxeNamedComponent) == HaxeComponentType.METHOD || HaxeComponentType.typeOf(haxeNamedComponent) == HaxeComponentType.FIELD)
{
final String nameToFind = haxeNamedComponent.getName();
if(nameToFind == null)
{
return true;
}
HaxeClass haxeClass = PsiTreeUtil.getParentOfType(haxeNamedComponent, HaxeClass.class);
assert haxeClass != null;
processInheritors(haxeClass.getQualifiedName(), queryParameters, new Processor<PsiElement>()
{
@Override
public boolean process(PsiElement element)
{
for(HaxeNamedComponent subHaxeNamedComponent : HaxeResolveUtil.getNamedSubComponents((HaxeClass) element))
{
if(nameToFind.equals(subHaxeNamedComponent.getName()))
{
consumer.process(subHaxeNamedComponent);
}
}
return true;
}
});
}
return true;
}
});
}
开发者ID:consulo,项目名称:consulo-haxe,代码行数:58,代码来源:HaxeInheritanceDefinitionsSearchExecutor.java
示例14: search
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
protected Query<PsiElement> search(PsiElement element, Editor editor) {
return DefinitionsScopedSearch.search(element, getSearchScope(element, editor), isSearchDeep());
}
开发者ID:consulo,项目名称:consulo,代码行数:4,代码来源:ImplementationSearcher.java
示例15: execute
import com.intellij.psi.search.searches.DefinitionsScopedSearch; //导入依赖的package包/类
@Override
public boolean execute(@NotNull DefinitionsScopedSearch.SearchParameters queryParameters, @NotNull Processor<PsiElement> consumer)
{
final PsiElement sourceElement = queryParameters.getElement();
return !(sourceElement instanceof PsiClass) || processImplementations((PsiClass) sourceElement, consumer, queryParameters.getScope());
}
开发者ID:consulo,项目名称:consulo-java,代码行数:7,代码来源:ClassImplementationsSearch.java
注:本文中的com.intellij.psi.search.searches.DefinitionsScopedSearch类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论