Java 类com.intellij.psi.scope.JavaScopeProcessorEvent 实例源码

项目:consulo-java    文件:PsiJavaFileBaseImpl.java   
@Override
public boolean process(SymbolCollectingProcessor.ResultWithContext result)
{
    final PsiElement context = result.getFileContext();
    myProcessor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, context);
    final PsiNamedElement element = result.getElement();

    if(element instanceof PsiClass && context instanceof PsiImportStatement)
    {
        final PsiClass containingClass = ((PsiClass) element).getContainingClass();
        if(containingClass != null && containingClass.hasTypeParameters())
        {
            return myProcessor.execute(element, myState.put(PsiSubstitutor.KEY, createRawSubstitutor(containingClass)));
        }
    }

    return myProcessor.execute(element, myState);
}
项目:consulo-java    文件:JavaCompletionProcessor.java   
@Override
public void handleEvent(@NotNull Event event, Object associated)
{
    if(event == JavaScopeProcessorEvent.START_STATIC)
    {
        myStatic = true;
    }
    if(event == JavaScopeProcessorEvent.CHANGE_LEVEL)
    {
        myMembersFlag = true;
        myFinishedScopesMethodNames.addAll(myCurrentScopeMethodNames);
        myCurrentScopeMethodNames.clear();
    }
    if(event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT)
    {
        myDeclarationHolder = (PsiElement) associated;
    }
}
项目:intellij-ce-playground    文件:MethodsProcessor.java   
@Override
public void handleEvent(@NotNull Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.START_STATIC) {
    myStaticScopeFlag = true;
  }
  else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) {
    myCurrentFileContext = (PsiElement)associated;
  }
}
项目:intellij-ce-playground    文件:MethodResolverProcessor.java   
@Override
public void handleEvent(@NotNull Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) {
    if (myHasAccessibleStaticCorrectCandidate) myStopAcceptingCandidates = true;
  }
  super.handleEvent(event, associated);
}
项目:intellij-ce-playground    文件:PsiScopesUtil.java   
public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor,
                                 @NotNull final PsiElement entrance,
                                 @Nullable final PsiElement maxScope,
                                 @NotNull final ResolveState state) {
  if (!entrance.isValid()) {
    LOG.error(new PsiInvalidElementAccessException(entrance));
  }
  PsiElement prevParent = entrance;
  PsiElement scope = entrance;

  while (scope != null) {
    ProgressIndicatorProvider.checkCanceled();
    if (scope instanceof PsiClass) {
      processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, scope);
    }
    if (!scope.processDeclarations(processor, state, prevParent, entrance)) {
      return false; // resolved
    }

    if (scope instanceof PsiModifierListOwner && !(scope instanceof PsiParameter/* important for not loading tree! */)) {
      PsiModifierList modifierList = ((PsiModifierListOwner)scope).getModifierList();
      if (modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC)) {
        processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null);
      }
    }
    if (scope == maxScope) break;
    prevParent = scope;
    scope = prevParent.getContext();
    processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null);
  }

  return true;
}
项目:intellij-ce-playground    文件:SymbolCollectingProcessor.java   
@Override
public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) {
    myCurrentFileContext = (PsiElement)associated;
    myCurrentContextAnchor = null;
  }
}
项目:intellij-ce-playground    文件:VariableResolverProcessor.java   
@Override
public final void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) {
  super.handleEvent(event, associated);
  if(event == JavaScopeProcessorEvent.START_STATIC){
    myStaticScopeFlag = true;
  }
  else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) {
    myCurrentFileContext = (PsiElement)associated;
  }
}
项目:intellij-ce-playground    文件:PsiJavaFileBaseImpl.java   
@Override
public void handleEvent(@NotNull final Event event, final Object associated) {
  if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event) && associated instanceof PsiImportStaticStatement) {
    final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement)associated;
    myIsProcessingOnDemand = importStaticStatement.isOnDemand();
    if (!myIsProcessingOnDemand) {
      myHiddenNames.add(importStaticStatement.getReferenceName());
    }
  }
  myDelegate.handleEvent(event, associated);
}
项目:intellij-ce-playground    文件:PsiJavaFileBaseImpl.java   
@Override
public boolean process(SymbolCollectingProcessor.ResultWithContext result) {
  final PsiElement context = result.getFileContext();
  myProcessor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, context);
  final PsiNamedElement element = result.getElement();

  if (element instanceof PsiClass && context instanceof PsiImportStatement) {
    final PsiClass containingClass = ((PsiClass)element).getContainingClass();
    if (containingClass != null && containingClass.hasTypeParameters()) {
      return myProcessor.execute(element, myState.put(PsiSubstitutor.KEY, createRawSubstitutor(containingClass)));
    }
  }

  return myProcessor.execute(element, myState);
}
项目:intellij-ce-playground    文件:JavaCompletionProcessor.java   
@Override
public void handleEvent(@NotNull Event event, Object associated){
  if(event == JavaScopeProcessorEvent.START_STATIC){
    myStatic = true;
  }
  if(event == JavaScopeProcessorEvent.CHANGE_LEVEL){
    myMembersFlag = true;
  }
  if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) {
    myDeclarationHolder = (PsiElement)associated;
  }
}
项目:intellij-ce-playground    文件:AbstractQualifiedReference.java   
@Override
public void handleEvent(@NotNull final Event event, final Object associated) {
  if ((event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT || event == Event.SET_DECLARATION_HOLDER) && !myResults.isEmpty()) {
    setFound();
  }
  super.handleEvent(event, associated);
}
项目:intellij-ce-playground    文件:ResolveUtil.java   
static void issueLevelChangeEvents(PsiScopeProcessor processor, PsiElement run) {
  processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null);
  if (run instanceof GrClosableBlock && GrClosableBlock.OWNER_NAME.equals(getNameHint(processor)) ||
      run instanceof PsiClass && !(run instanceof PsiAnonymousClass) ||
      run instanceof GrMethod && run.getParent() instanceof GroovyFile) {
    processor.handleEvent(DECLARATION_SCOPE_PASSED, run);
  }
}
项目:intellij-ce-playground    文件:MethodResolverProcessor.java   
@Override
public void handleEvent(@NotNull Event event, Object associated) {
  super.handleEvent(event, associated);
  if (JavaScopeProcessorEvent.CHANGE_LEVEL == event && hasApplicableCandidates()) {
    myStopExecuting = true;
  }
}
项目:eddy    文件:EnvironmentProcessor.java   
@Override public final void handleEvent(final @NotNull Event event, final Object associated) {
  if (event == JavaScopeProcessorEvent.START_STATIC) {
    //log("starting static scope at " + currentLevel);
    inStaticScope = true;
  } else if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) {
    if (associated instanceof PsiAnonymousClass)
      classes.add(new Shadow<PsiClass>((PsiClass)associated,currentLevel));
    //log("switching context: " + associated);
  } else if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) {
    currentLevel++;
    //log("change level to " + currentLevel + ", associated " + associated);
  }
}
项目:eddy    文件:EnvironmentProcessorTest.java   
@Override
public final void handleEvent(@NotNull Event event, Object associated){
  if (event == JavaScopeProcessorEvent.START_STATIC) {
    logger.debug("starting static scope");
    inStaticScope = true;
  } else if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) {
    currentFileContext = (PsiElement)associated;
    logger.debug("switching file context: " + currentFileContext);
  } else if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) {
    currentLevel++;
    logger.debug("change level to " + currentLevel);
  }
}
项目:tools-idea    文件:MethodsProcessor.java   
@Override
public void handleEvent(Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.START_STATIC) {
    myStaticScopeFlag = true;
  }
  else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) {
    myCurrentFileContext = (PsiElement)associated;
  }
}
项目:tools-idea    文件:MethodResolverProcessor.java   
@Override
public void handleEvent(Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.CHANGE_LEVEL) {
    if (myHasAccessibleStaticCorrectCandidate) myStopAcceptingCandidates = true;
  }
  super.handleEvent(event, associated);
}
项目:tools-idea    文件:PsiScopesUtil.java   
public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor,
                                 @NotNull final PsiElement entrance,
                                 @Nullable final PsiElement maxScope,
                                 @NotNull final ResolveState state) {
  if (!entrance.isValid()) {
    LOG.error(new PsiInvalidElementAccessException(entrance));
  }
  PsiElement prevParent = entrance;
  PsiElement scope = entrance;

  while (scope != null) {
    ProgressIndicatorProvider.checkCanceled();
    if (scope instanceof PsiClass) {
      processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, scope);
    }
    if (!scope.processDeclarations(processor, state, prevParent, entrance)) {
      return false; // resolved
    }

    if (scope instanceof PsiModifierListOwner && !(scope instanceof PsiParameter/* important for not loading tree! */)) {
      PsiModifierList modifierList = ((PsiModifierListOwner)scope).getModifierList();
      if (modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC)) {
        processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null);
      }
    }
    if (scope == maxScope) break;
    prevParent = scope;
    scope = prevParent.getContext();
    processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null);
  }

  return true;
}
项目:tools-idea    文件:VariableResolverProcessor.java   
@Override
public final void handleEvent(PsiScopeProcessor.Event event, Object associated) {
  super.handleEvent(event, associated);
  if(event == JavaScopeProcessorEvent.START_STATIC){
    myStaticScopeFlag = true;
  }
  else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) {
    myCurrentFileContext = (PsiElement)associated;
  }
}
项目:tools-idea    文件:PsiJavaFileBaseImpl.java   
@Override
public void handleEvent(final Event event, final Object associated) {
  if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event) && associated instanceof PsiImportStaticStatement) {
    final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement)associated;
    myIsProcessingOnDemand = importStaticStatement.isOnDemand();
    if (!myIsProcessingOnDemand) {
      myHiddenNames.add(importStaticStatement.getReferenceName());
    }
  }
  myDelegate.handleEvent(event, associated);
}
项目:tools-idea    文件:JavaCompletionProcessor.java   
@Override
public void handleEvent(Event event, Object associated){
  if(event == JavaScopeProcessorEvent.START_STATIC){
    myStatic = true;
  }
  if(event == JavaScopeProcessorEvent.CHANGE_LEVEL){
    myMembersFlag = true;
  }
  if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) {
    myDeclarationHolder = (PsiElement)associated;
  }
}
项目:tools-idea    文件:AbstractQualifiedReference.java   
@Override
public void handleEvent(final Event event, final Object associated) {
  if ((event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT || event == Event.SET_DECLARATION_HOLDER) && !myResults.isEmpty()) {
    setFound();
  }
  super.handleEvent(event, associated);
}
项目:tools-idea    文件:ResolveUtil.java   
static void issueLevelChangeEvents(PsiScopeProcessor processor, PsiElement run) {
  processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null);
  if (run instanceof GrClosableBlock && GrClosableBlock.OWNER_NAME.equals(getNameHint(processor)) ||
      run instanceof PsiClass && !(run instanceof PsiAnonymousClass) ||
      run instanceof GrMethod && run.getParent() instanceof GroovyFile) {
    processor.handleEvent(DECLARATION_SCOPE_PASSED, run);
  }
}
项目:tools-idea    文件:MethodResolverProcessor.java   
@Override
public void handleEvent(Event event, Object associated) {
  super.handleEvent(event, associated);
  if (JavaScopeProcessorEvent.CHANGE_LEVEL == event && super.hasCandidates()) {
    myStopExecuting = true;
  }
}
项目:consulo-java    文件:ConflictFilterProcessor.java   
@Override
public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated)
{
    if(event == JavaScopeProcessorEvent.CHANGE_LEVEL && myName != null)
    {
        getResult();
    }
}
项目:consulo-java    文件:MethodsProcessor.java   
@Override
public void handleEvent(@NotNull Event event, Object associated)
{
    if(event == JavaScopeProcessorEvent.START_STATIC)
    {
        myStaticScopeFlag = true;
    }
    else if(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event))
    {
        myCurrentFileContext = (PsiElement) associated;
    }
}
项目:consulo-java    文件:MethodResolverProcessor.java   
@Override
public void handleEvent(@NotNull Event event, Object associated)
{
    if(event == JavaScopeProcessorEvent.CHANGE_LEVEL)
    {
        if(myHasAccessibleStaticCorrectCandidate)
        {
            myStopAcceptingCandidates = true;
        }
    }
    super.handleEvent(event, associated);
}
项目:consulo-java    文件:PsiScopesUtil.java   
public static boolean treeWalkUp(@NotNull final PsiScopeProcessor processor, @NotNull final PsiElement entrance, @Nullable final PsiElement maxScope, @NotNull final ResolveState state)
{
    if(!entrance.isValid())
    {
        LOG.error(new PsiInvalidElementAccessException(entrance));
    }
    PsiElement prevParent = entrance;
    PsiElement scope = entrance;

    while(scope != null)
    {
        ProgressIndicatorProvider.checkCanceled();
        if(scope instanceof PsiClass)
        {
            processor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, scope);
        }
        if(!scope.processDeclarations(processor, state, prevParent, entrance))
        {
            return false; // resolved
        }

        if(scope instanceof PsiModifierListOwner && !(scope instanceof PsiParameter/* important for not loading tree! */))
        {
            PsiModifierList modifierList = ((PsiModifierListOwner) scope).getModifierList();
            if(modifierList != null && modifierList.hasModifierProperty(PsiModifier.STATIC))
            {
                processor.handleEvent(JavaScopeProcessorEvent.START_STATIC, null);
            }
        }
        if(scope == maxScope)
        {
            break;
        }
        prevParent = scope;
        scope = prevParent.getContext();
        processor.handleEvent(JavaScopeProcessorEvent.CHANGE_LEVEL, null);
    }

    return true;
}
项目:consulo-java    文件:ClassResolverProcessor.java   
@Override
public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated)
{
    if(event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT)
    {
        myCurrentFileContext = (PsiElement) associated;
    }
}
项目:consulo-java    文件:VariableResolverProcessor.java   
@Override
public final void handleEvent(PsiScopeProcessor.Event event, Object associated) {
  super.handleEvent(event, associated);
  if(event == JavaScopeProcessorEvent.START_STATIC){
    myStaticScopeFlag = true;
  }
  else if (JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event)) {
    myCurrentFileContext = (PsiElement)associated;
  }
}
项目:consulo-java    文件:PsiJavaFileBaseImpl.java   
@Override
public void handleEvent(final Event event, final Object associated)
{
    if(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT.equals(event) && associated instanceof PsiImportStaticStatement)
    {
        final PsiImportStaticStatement importStaticStatement = (PsiImportStaticStatement) associated;
        myIsProcessingOnDemand = importStaticStatement.isOnDemand();
        if(!myIsProcessingOnDemand)
        {
            myHiddenNames.add(importStaticStatement.getReferenceName());
        }
    }
    myDelegate.handleEvent(event, associated);
}
项目:consulo-java    文件:AbstractQualifiedReference.java   
@Override
public void handleEvent(final Event event, final Object associated) {
  if ((event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT || event == Event.SET_DECLARATION_HOLDER) && !myResults.isEmpty()) {
    setFound();
  }
  super.handleEvent(event, associated);
}
项目:intellij-ce-playground    文件:VariablesProcessor.java   
@Override
public final void handleEvent(@NotNull Event event, Object associated){
  if(event == JavaScopeProcessorEvent.START_STATIC)
    myStaticScopeFlag = true;
}
项目:intellij-ce-playground    文件:ConflictFilterProcessor.java   
@Override
public void handleEvent(@NotNull PsiScopeProcessor.Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.CHANGE_LEVEL && myName != null) {
    getResult();
  }
}
项目:intellij-ce-playground    文件:VariablesProcessor.java   
@Override
public final void handleEvent(@NotNull Event event, Object associated){
  if(event == JavaScopeProcessorEvent.START_STATIC)
    myStaticScopeFlag = true;
}
项目:tools-idea    文件:ConflictFilterProcessor.java   
@Override
public void handleEvent(PsiScopeProcessor.Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.CHANGE_LEVEL && myName != null) {
    getResult();
  }
}
项目:tools-idea    文件:SymbolCollectingProcessor.java   
@Override
public void handleEvent(PsiScopeProcessor.Event event, Object associated) {
  if (event == JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT) {
    myCurrentFileContext = (PsiElement)associated;
  }
}
项目:tools-idea    文件:PsiJavaFileBaseImpl.java   
@Override
public boolean process(SymbolCollectingProcessor.ResultWithContext result) {
  myProcessor.handleEvent(JavaScopeProcessorEvent.SET_CURRENT_FILE_CONTEXT, result.getFileContext());
  return myProcessor.execute(result.getElement(), myState);
}
项目:tools-idea    文件:VariablesProcessor.java   
@Override
public final void handleEvent(Event event, Object associated){
  if(event == JavaScopeProcessorEvent.START_STATIC)
    myStaticScopeFlag = true;
}
项目:tools-idea    文件:VariablesProcessor.java   
@Override
public final void handleEvent(Event event, Object associated){
  if(event == JavaScopeProcessorEvent.START_STATIC)
    myStaticScopeFlag = true;
}